In this guide, I’ll show you how the steps to create a database in SQL Server Management Studio using a simple example.
Steps to Create a Database in SQL Server Management Studio
Step 1: Open SQL Server
To start, open Microsoft SQL Server Management Studio.
To avoid any permission issues, you may want run SQL Server Management Studio as an administrator:
Step 2: Connect to your Server
Next, connect to your server:
Step 3: Navigate to the Object Explorer
After you connected to your server, you’ll be able to see the Object Explorer on the left-hand-side of your screen:
Step 4: Create your Database
Under the Object Explorer, you’ll see the Databases Folder. Right click on that folder and then select New Database… from the drop-down list:
Now you’ll be able to create your database by typing the name of your database in the entry box. For example, I typed the name of TestDB for my database. Once you’re done click on OK:
If you expand the Databases folder under the Object Explorer, you’ll see your newly created database:
You can then add tables to your database.
An Alternative Way to Create a Database in SQL Server
You can also create a database in SQL Server Management Studio by using the following query:
CREATE DATABASE yourdatabasename
For example, if you want to create a second database, called mySecondDatabase, then execute this query:
CREATE DATABASE mySecondDatabase
Right-click on the Databases folder under the Object Explorer, and then select Refresh from the drop-down list:
You’ll now see the second database that you just created:
Delete a Database in SQL Server
If you decide that a database is no longer needed, you can simply delete it by right-clicking on the database name (under the Databases folder), and then selecting the Delete option from the drop-down list.
For example, let’s say that you no longer need the mySecondDatabase database, then:
(1) Right-click on the mySecondDatabase
(2) Select the Delete option