Partager via


How to: Create Tables

Using Table Designer, you can create a new table, name it, and add it to an existing database.

Note

A new version of Table Designer appears for databases in the SQL Server 2012 format. This topic describes the old version of Table Designer, which you use with databases in earlier formats of SQL Server.

In the new version, you can change a table definition through a graphical interface or directly in a script pane. If you use the graphical interface, the table’s definition is automatically updated in the script pane. To apply the SQL code in the script pane, choose the Update button. For more information about the new version, see How to: Create Database Objects Using Table Designer.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Customizing Development Settings in Visual Studio.

To create a new table with Table Designer

  1. Make sure you are connected to the database in which you want to create the table and that it is selected in Server Explorer.

    For more information on connecting to a database see How to: Connect to a Database from Server Explorer.

  2. From the Data menu, point to Add New and then click Table.

  3. Type column names, choose data types, and choose whether to allow nulls for each column.

  4. From the File menu, choose Save table name.

  5. In the Choose Name dialog box, type a name for the table and click OK.

See Also

Reference

Table Properties

Other Resources

Working with Tables in Table Designer

Understanding Visual Database Tools