How to create a database in SQL Server 2019

In this SQL Server tutorial, you will learn about MSSQL create database. The database is a collection of information that we can view, change, and delete. This tutorial explains step by step how to create a database using MSSQL.

How to create a database in SQL Server 2019

To create a database in SQL Server 2019, follow the below steps.

1. As a 1st and foremost step, type SQL server management studio in the search bar of Windows, and the below image will appear.

Create Database in SQL Express

2. Now, the SQL Server page will appear. Select Windows Authentication and click Connect.

Create MSSQL Database

3. Once you click Connect, then under the server name, you will see the list of options.

Create MSSQL Server Database

4. Here, right-click the Databases and click Create New Database.

how to create database in sql server express

5. Now, give the Database name and click OK. [For example, I have given SQLDB].

Create Database in MSSQL

6. Click the Options page, and in the Collation option, choose SQL_Latin1_General_CP1_C1_AS and click OK.

how to create a database in sql server 2012 express

7. Click Logins by expanding the Security options. Right-click on Logins and click New Login..

how to create a database in sql server 2019 express

8. Now, the Login—New page will appear. Here, provide the Login name and select SQL Server Authentication. Provide the password and confirm it. Provide the Default database you created recently and click OK.

create database sql server 2019

9. In the Object Explorer panel, expand Databases > <dbname> > Security > Users. Select Users from the option.

10. Right-click Users and select New User.

how to create database in sql server 2019

11. In all the fields, give the same name to the User name, Login name, and Default schema as you gave for the login name, which is imsdbusr.

how to create database in sql server 2019 management studio

12. Now, on the left side, under Select a page, Click Membership and tickmark the checkbox db_owner.

create a database in sql server 2019

13. Here, click Schema and right-click New Schema by expanding Security. Give it the same name as imsdbusr.

create database in sql server 2019

14. Give the same name imsdbusr in the Schema name and Schema owner, and click OK.

create database in sql server 2019 management studio

You have created the database successfully. Now, close the management studio.

Conclusion

I hope this is the easiest and best method to connect to the database in MS SQL Server. Also, I explained how to create schema and create new users as well. Try from your side by following each and every step.

You may like to read:

Top 200 SQL Server Interview Questions and Answers

Free PDF On Top 200 SQL Server Interview Questions And Answers

Download A 40 pages PDF And Learn Now.