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.
Table of Contents
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.
In SSMS, follow these steps to create the database:
- Select the instance : localhost
- Then right-click on Databases
- And select the New Database... option in the contextual 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.
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:
- Using the SSMS GUI (Graphical User Intefacer)
- Using the Generate Script option from the right click on an existing database.
- 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.