How to create a database in SQL Server 2014 using the dBeaver GUI tool?

- 142,137
- 41
- 261
- 360

- 297
- 1
- 3
- 10
-
7`CREATE DATABASE YourDatabase` is the minimal code required. – Martin Smith Dec 27 '17 at 15:52
-
How do you set up international collation? such as unicode, utf ... ? – Pathros Apr 08 '22 at 17:47
3 Answers
It isn't supported yet, as devs explain:
Database create not yet supported for SQL Server (will be added as a part of #810).

- 142,137
- 41
- 261
- 360
You can create database by commands like below:
--create where
USE master;
GO
--check if exists
IF DB_ID (N'MyDatabaseTest') IS NULL
DROP DATABASE MyOptionsTest;
GO
--create database
CREATE DATABASE MyDatabaseTest
COLLATE SQL_Latin1_General_CP1_CI_AS
WITH TRUSTWORTHY ON, DB_CHAINING ON;
GO
--Verifying collation and option settings.
SELECT name, collation_name, is_trustworthy_on, is_db_chaining_on
FROM sys.databases
WHERE name = N'MyOptionsTest';
GO
If you want to delete existing one, use below command:
IF DB_ID (N'MyDatabaseTest') IS NOT NULL
DROP DATABASE MyDatabaseTest;

- 1,002
- 1
- 8
- 12
-
still not supported. See ticket -> [github issue](https://github.com/dbeaver/dbeaver/issues/2330) – Martin Faucheux Dec 04 '19 at 11:11
-
Answer
Just to make this clear for anyone wondering how to create a database in DBeaver:
You cannot create a database in DBeaver.
This is already the answer to the question.
Beyond the answer
You can only connect to a database that is already there.
What is more, DBeaver does not install the database driver that you need to make the needed database when you make a new connection. DBeaver only installs the drivers for the DBeaver GUI (Graphical User Interface), that is what you see running at a cold start. You need to download and install the database driver yourself and set up a database yourself. Just make a new one in the console or in another GUI. Taking up the comment from above:
CREATE DATABASE YourDatabase
is the minimal code required.
And only then, you can connect to it:
With the host, port, database, username and password that depends on your settings outside of DBeaver.
I did this only for PostgreSQL, but it should be the same for SQL Server. Before I had installed PostgreSQL, DBeaver threw:
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. Connection refused: connect
After installing PostgreSQL, DBeaver said that it did not know the databases, but the error was gone. After making the database with pgAdmin 4, I could see everything in DBeaver as well.

- 7,175
- 4
- 57
- 90