I want to add a Column to a table in my Database
. As several data already exist in that particular table
, MSSQL
does not allow me to add a not Null field. So I can use a default keyword to solve this problem and run the below mentioned Query
-
Alter table ServiceDetails
Add OCF_Internal_ID varchar(50) not null default 'OCF';
But now I want to make the "OCF_Internal_ID"
field Primary key
and I need to insert unique values to the every record of that particular filed. Please give me any suggestion.
How can I add Unique values to all the existing records ?