I have a primary key constraint to my column, i disabled it and inserted duplicate values into the column after how can I enable the primary key constraint
How can I enable the primary key constraint
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rajanikant HawaldarRank #110 · 20.2K reputationPosted Oct 11, 2022, 10:34 AM EDT
No it won't allow in any case, that is difference between constraints and rules. If you implement constraints it will check the previous data also, but if you implement rule in that case then no problem you can have the dublicates, but here also after implementing rule you are not allowed to put dublicates
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 12, 2022, 12:48 AM EDT
Hi Rajesh,
First of all if you have duplicate data in that table then you can not set primery key to column. You need to take back up of that table then create primary key and insert data from backup table after removing duplicate record.