A primary key can't be created on column '<0s>' because it allows null values.

Message Text

A primary key can't be created on column '<0s>' because it allows null values.

Explanation

The primary key is used to relate the table to foreign keys in other tables. All columns participating in a primary key must contain defined values other than NULL.

Action

To create a primary key on the selected column, first clear the Allow Nulls check box for the column.

See Also
ALTER TABLE How to create a PRIMARY KEY constraint on an existing table (Enterprise Manager)
Constraints InPrimaryKey Property
CREATE TABLE Key Object
Creating and Modifying PRIMARY KEY Constraints Modifying Column Properties
HasPrimaryKey Property Primary Key Constraints
How to create a PRIMARY KEY constraint when creating a table (Enterprise Manager) SQLPrimaryKeys

 

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.