-- Add new identity column and auto populate with id number.
ALTER TABLE dbo.tblTable01
   ADD colId INT IDENTITY

-- Create unique constraint.
ALTER TABLE dbo.tblTable01  
ADD CONSTRAINT UN_tblTable01_colId UNIQUE (colId);   
Last modified: December 3, 2019

Author

Comments

Write a Reply or Comment