How To Create a SQL Server Database with SSMS ?

Step by step tutorial to create a SQL Server database using SSMS (SQL Server Management Studio).

How to create a SQL Server database with SQL Server Management Studio, i.e. SSMS. In this tutorial, let’s learn how to add a new MS SQL database to an instance. Indeed, to start, it’s mandatory to create a database to create and use SQL objects. It is possible to perform almost all possible operations on a SQL Server database from SSMS, here it is SQL Server Management Studio 18. To install a database instance on your machine, start by installing SQL Server 2017 or 2019 for example.

To create a database with a T-SQL script check this tutorial with examples of code. Both options are valuable, once automating the deployments then the scripting option is the one to choose. Especially with multiple databases in fast changing environments like DevOps project deployment methodology for example.

1. Open SSMS and the new database menu

First, from the PC or the Windows Server, to open SQL Server Management Studio, follow these steps:

  • Go to Program Files
  • Select Microsoft SQL Server
  • And then Microsoft SQL Server Management Studio

There might be a list of existing databases in the DBMS (Database Management System), at least the system database. If the current privileges are high enough to see them. Connect to the target instance, here it is the localhost server, and a SQL Server Authentication.

Connect to the database server to create the database in SQL Server Management Studio.
Connect to the database server to create the database

In SSMS, follow these steps to create the database:

  1. Select the instance : localhost
  2. Then right-click on Databases
  3. And select the New Database... option in the contextual menu.
Right-Click to open the New Database menu on SSMS
Right-Click to open the New Database menu

2. Configure the database options

Secondly, in the New Database window enter the name of the new SQL Server database. We call the database DB2_ExpertOnly. Because other databases are already created on the server. In this example, the default settings are kept, for example:

  • The Initial size of the database (5 megabytes) and the size of the log file (1 megabyte).
  • The Autogrowth and Maxsize options per default are respectively 10 percent and unlimited.
Create the database name and leave the default SSMS options
Create the database name and leave the default SSMS options

3. Video tutorial to create the MS SQL database

The SSMS tutorial on how to create a database is also available in a video format on our Youtube channel. This video expose 3 different ways to create a SQL Server database:

  1. Using the SSMS GUI (Graphical User Intefacer)
  2. Using the Generate Script option from the right click on an existing database.
  3. Using a simple CREATE DATABASE statement script.

Conclusion on database creation with SSMS

This example shows how to easily create a new SQL Server database from the graphic user interface, also called GUI, with no lines of code. This applies to all existing versions, with some variations in the options and display.

More SQL Server tutorials to manage databases

Be the first to comment

Leave a Reply

Your email address will not be published.