How to Create a Table in SQL Server Management Studio

In this tutorial, I’ll show you the steps to create a table in SQL Server Management Studio. I’ll use a simple example to demonstrate this concept.

Steps to Create a Table in SQL Server Management Studio

Step 1: Create a database

If you haven’t already done so, create a database in SQL Server Management Studio. For illustration purposes, I created a database called TestDB:

Database sql server

Note: To avoid any permission issues, you may want to run SQL Server Management Studio as an administrator.

Step 2: Create a table

Under your database (for example TestDB), right-click on the Tables folder, and then select Table… from the drop-down list:

How to Create a Table in SQL Server Management Studio

You’ll now be able to create your table. For example, let’s say that you want to create a table called Person. This table would have 3 columns:

  • Name
  • Age
  • City

Next, fill those column names and their data types:

Create a Table in SQL Server Management Studio

Once you’re done, click on Save:

Save a table

Type ‘Person‘ for your table name, and then click OK:

Table name

You should now see the new table (dbo.Person) under the Tables folder associated with your database:

Table in SQL Server Management Studio

Note: you may need to refresh the Tables folder first. You can do that by right-clicking on the Tables folder and then selecting Refresh from the drop-down list:

Refresh tables

Step 3: Add values to the table

Let’s add the following values to our table:

NameAgeCity
Jade20London
Mary119NY
Martin25London
Rob35Geneva
Maria42Paris
Jon28Toronto

You can add values into a table by using an insert query:

INSERT INTO Database_Name.Table_Name (Column1_Name, Column2_Name,...)

VALUES

('Column1_Value1', 'Column2_Value2',...),

('Column1_Value3', 'Column2_Value4',...)

And for our example, you can run the following query in SQL Server:

INSERT INTO TestDB.dbo.Person (Name,Age,City)

VALUES

('Jade',20,'London'),
('Mary',119,'NY'),
('Martin',25,'London'),
('Rob',35,'Geneva'),
('Maria',42,'Paris'),
('Jon',28,'Toronto')

This is how the query should look like in SQL Server:

Insert into SQL server

Step 4: Verify that the values got inserted into the table

You can verify that the values got inserted into the table, by running the following query:

select * from TestDB.dbo.Person

You should then get the results below:

Example of table in SQL