How to enable primary keys for the populated tables?
When I created the tables and the constraints, I forgot to do the following:
ALTER DATABASE warehouse SET EnableNewPrimaryKeysByDefault = 1;
ALTER DATABASE warehouse SET EnableNewUniqueKeysByDefault = 1;
Now I have populated the tables, how can I enforce the primary keys without staring over?
0
Comments
You can enable a constraint on an already populated table with ALTER TABLE. The constraint would be enforced for current content as well as content you add to the table later.