Primary Keys Wizard (SQL Server)

From DBArtisan
Jump to: navigation, search

Go Up to Microsoft SQL Server Object Wizards

Primary key constraints make sure that no duplicate values or NULLS are entered in the columns you specify. You can use primary key constraints to enforce uniqueness and referential integrity. A table can only have a single primary key constraint.

The dialog box lets you specify the owner and table on which you want to place the primary key constraint.

To create a new primary key using a wizard:

  1. Open a creation wizard for a primary key. For details, see Opening an Object Wizard.
  2. Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:
  3. Finally, use the Execute button to create the object.

Primary Keys (SQL Server) - Properties

When creating or editing a primary key, this tab/panel lets you work with the following settings:

Setting Description

Table Owner and Table Name

Choose the owner and name of the table in which the primary key is being created.


Provide a name of the primary key being created.

Build Online

Enabling this feature specifies that the ONLINE=ON clause is used when creating this object and can subsequently be used when rebuilding or dropping this object.

Max degree of parallelism

Lets you specify a MAXDOP index operation value, limiting the number of processors used in parallel plan execution.


Enable or disable clustering. With this check box enabled, subsequent rebuild and drop operations offer an online option.

File Group

If you do not specify a filegroup, Microsoft SQL Server creates the index in the default filegroup.

Fill Factor

This specifies how full each index page that’s storing data should be. The fill factor is a percentage value between 0 and 100.

Primary Keys (SQL Server) - Columns

From the Column dropdown, select a column for the primary key and specify a Sort option. To add more columns, click the New button and then follow the steps in the last instruction. Use the Delete button to drop columns.