This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

SQL Server
SQL 2005+

Creating SQL Server Tables Part 1

The fifth part of the SQL Server Programming Fundamentals tutorial looks at the creation of tables within a SQL Server database. Tables provide structured storage locations for all of the information stored within a relational database.

Creating Tables

In this tutorial we will consider two methods for creating database tables. The first is using the graphical user interface aspects of SQL Server Management Studio and is examined in this article. The second, using Transact-SQL (T-SQL) commands and scripts, will be described in the next tutorial instalment. We will use these technologies to create tables within the sample JoBS database. If you have not done so already, create the empty JoBS database using the techniques described in the earlier article, Creating SQL Server Databases Part 1.

Creating Tables Using SQL Server Management Studio

In this section we will using SQL Server Management Studio (SSMS) to create a new table in the JoBS database. This table will hold the list of customers that receive services from DisasterFix. The usual naming convention for database tables is a name that describes the table's contents and is specified in Pascal case. In this case, we will name the table "Customers".

Object Explorer

To create the new table, expand the tree in the Object Explorer so that the Tables branch of the JoBS database is visible. Right-click this branch and select "New Table..." from the context-sensitive menu that appears. A new design window will be opened in the main area of SSMS and the Properties area will update to allow modification of the new table's options. At this point, the new table has not yet been created in the database.

5 July 2008