|
|
Question : Autonumbering Primary key
|
|
How do I add an autonumber primary key field to a table already created on SQL Server.
|
Answer : Autonumbering Primary key
|
|
ALTER TABLE yourtable ADD COLUMN PK INT IDENTITY(1,1) NOT NULL
ALTER TABLE yourtable ADD CONSTRAINT PK_yourtable PRIMARY KEY ( PK )
|
|
|
|