Primary Keys Wizard (SQL Server)
Go Up to [[Microsoft SQL Server Object Wizards{{#if:||{{{2}}}}}]]
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 have only 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
- Open a creation wizard for a primary key. For details, see Opening an Object Wizard.
- Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:
- Properties panel. For more information, see Primary Keys (SQL Server) - Properties.
- Columns panel. For more information, see Primary Keys (SQL Server) - Properties.
- DDL View panel. For more information, see Previewing the DDL Generated to Create the New Object.
- Click Execute 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. |
|
Name |
Provide a name of the primary key being created. |
|
Build Online |
Enabling this feature specifies that the |
|
Max degree of parallelism |
Lets you specify a |
|
Clustered |
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 New, and then follow the steps in the last instruction. Use Delete to drop columns.