How to Create Databases in SQL Server

In this post, we will see how to easily create databases in SQL Server. To this end, we will see a relevant example along with a short video.

 

Connecting to SQL Server with SQL Server Management Studio (SSMS)

The first step, prior to creating the database, is to connect to SQL Server, in our example using SSMS.

To connect to the SQL Server instance, you launch SSMS, you set the connection details and connect to SQL Server.

How to Create Databases in SQL Server - Article on EssentialDevTips.com

How to Create Databases in SQL Server - Article on EssentialDevTips.com

 

Creating the Database

Now that you have successfully connected to SQL Server, you can right click on “Databases” and select “New database“. This brings up the following dialog:

How to Create Databases in SQL Server - Article on EssentialDevTips.com

Within the above dialog, you can enter the name of your new database, as well as, control the database autogrowth settings.

 

Database Settings

In the “Options” tab, you can set any other options you would like to set for your new database.

How to Create Databases in SQL Server - Article on EssentialDevTips.com

After clicking the “OK” button, you can see that your new database has been created:

How to Create Databases in SQL Server - Article on EssentialDevTips.com

 

Creating a new Database Using T-SQL

Alternatively, if you want to create a database using T-SQL, you can do so by executing the CREATE DATABASE SQL statement, see the below example for more info:

CREATE DATABASE MyDatabase2;
GO

 

How to Create Databases in SQL Server - Article on EssentialDevTips.com

 

Learn More about SQL Server

Enroll to my online course on Udemy, titled “SQL Server Fundamentals – SQL Database for Beginners” and get started with SQL Server on both Windows and Linux in no time!

SQL Server Fundamentals - SQL Database for Beginners (Online Course)
(Lifetime Access, Downloadable Resources, Certificate of Completion and more!)

Enroll Now!

 

Featured Online Courses:

 

Read Also:

 

Featured Database Software Tool

SQLNetHub's Snippets Generator - Creating a New Snippet

SQLNetHub’s Snippets Generator 

Create and modify T-SQL code snippets for use in SQL Server Management Studio, fast, easy and efficiently.

Enroll to the Course

 

 

 

Reference: {essentialDevTips.com} (https://www.essentialdevtips.com/)

© essentialDevTips.com

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Loading...