Primary Key Constraint : Primary Key « Constraints « SQL Server / T-SQL Tutorial






A table's primary key is the primary value that is used to uniquely identify every row in the table.
The primary key designation is specified as a constraint on the table.
Constraints can be created during the initial CREATE TABLE statement or can be added later with an ALTER TABLE statement.

9>
10> CREATE TABLE MyTable (MyID Int IDENTITY(1,1) NOT NULL CONSTRAINT PK_ID PRIMARY KEY
11>           , Description nVarChar(50) NOT NULL
12>           , Region nVarChar(10) NOT NULL DEFAULT 'PNW' )
13> GO
1>
2> drop table MyTable;
3> GO
1>








7.2.Primary Key
7.2.1.Primary Key Constraint
7.2.2.The PRIMARY KEY Clause
7.2.3.Define constraint name for primary key
7.2.4.PRIMARY KEY (cust_id)
7.2.5.You cannot add another primary key to table
7.2.6.NONCLUSTERED PRIMARY KEY
7.2.7.Using a Multicolumn Primary Key