I am trying to add primary key to newly added column in existing table name
ALTER TABLE Product_Details
ADD CONSTRAINT pk_Product_Detils_Product_Detail_ID PRIMARY KEY(Product_Detail_ID)
Thestatement terminated because a duplicate key was found for the object name
CREATE UNIQUE INDEXand the index name
'dbo.Product\_Details'. The duplicate key value is (0).
I thank all of you for your prompt and helpful reply:
With reference of Timo Hahn's comment I insert the data into column and then execute with following query and it worked.
ALTER TABLE Product_Details ADD CONSTRAINT pk_Product_Detils_Product_Detail_ID primary key(Product_Detail_ID) GO
Thank you all