How to Create Databases in SQL Server

Share this article!

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 - TechHowTos

 

How to Create Databases in SQL Server - TechHowTos

 

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 - TechHowTos

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 - TechHowTos

 

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

How to Create Databases in SQL Server - TechHowTos

 

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 - TechHowTos

 

Watch the Video on our YouTube Channel!

Watch our video on how to create databases in SQL Server!

Subscribe!

 

Learn More – Enroll to the Course!

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

SQLNetHub’s Snippets Generator 

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

Learn More

 

 

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Loading...

Reference: TechHowTos.com (https://www.techhowtos.com)

© TechHowTos.com