How to Create a Table in SQL Server

To create a table in SQL Server using the GUI:

  1. Ensuring that the right database is expanded in Object Explorer, right click on the Tables icon and select Table... from the contextual menu
  2. A new table will open in Design view. Add the columns, their data types, and column properties.
  3. Save the table (either from the File menu, or by right-clicking on the table tab and selecting Save Table1)

The table will appear in the Object Explorer under the Tables icon for the applicable database.

Below are screenshots for the above steps.

Right-Click on “Tables”

Ensuring that the right database is expanded in Object Explorer, right click on the Tables icon and select Table... from the contextual menu:

Screenshot of right-clicking on the Tables contextual menu in SQL Server 2014
Right-clicking on “Tables” brings up the contextual menu. To create a new table, click “Table…”

The New Table in Design View

A new table will open in Design view. Add the columns, their data types, and column properties:

Screenshot of table in Design view in SQL Server 2014.
A new table in Design view after some columns have been added. Clicking in a column name in the top pane will display its properties in the bottom pane. Modify these as required or leave them at the default values.

Save the Table

Save the table (either from the File menu, or by right-clicking on the table tab and selecting Save Table_1):

Screenshot of right-clicking on the table tab in SQL Server 2014.
Right-clicking on the table’s tab will present the “Save…” option.

Name the table at the prompt and your table will be added to the database.

Check the New Table

It’s good practice to check that the table has been created in the correct database and has all the correct columns and data types.

You will be able to see the new table in the Object Explorer. If you can’t immediately see the new table in the Object Explorer, right click on Tables and click Refresh:

Screenshot of refreshing the Object Explorer in SQL Server 2014.
You may need to refresh the table list before you see the new table in the Object Explorer.

 

When you can see the table in the Object Explorer, expand it to reveal all the columns and their respective data types:

Screenshot of expanded table in the Object Explorer in SQL Server 2014.
Expanding a table in the Object Explorer displays the table’s columns.

Create a Table using a Query

You can also create a table using a query.