II.4.1. Building a New Table

Before we get started, it's worth pointing out that, for this chapter, we spend most of the time in the SQL Server Management Studio. If you're inclined to use the character-based SQLCMD utility instead, it's no problem. We also show you how to use this utility to create new tables.

To begin, here is how you start the SQL Server Management Studio and prepare it to create new tables:

  1. Launch the SQL Server Management Studio.

  2. Connect to the appropriate SQL Server instance.

  3. Expand the connection's entry in the Object Explorer view.

  4. Expand the Databases folder.

  5. Right-click the Tables folder and choose New Table.

That's all there is to it. You see a dialog box containing a grid that allows you to start entering details about your table. Figure 4-1 shows you how this empty dialog box appears.

Figure II.4-1. Creating a new table in the SQL Server Management Studio.

After this dialog box is in front of you, here's what you do to create your table:

  1. For each column in your table, enter a unique name.

    After you've done this naming, the bottom half of the dialog box contains many configurable settings for this column, as shown in Figure 4-2. We spend a fair amount of time examining each of these settings.

    Figure II.4-2. Setting column properties in the SQL Server Management Studio.
  2. Pick from one of the data types shown in the drop-down box.

    If you're curious about ...

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.