Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing unique field that has FK
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01546968
Message ID:
01546973
Views:
49
>Hi,
>
>I ran into the following issue (not major but I want to see if there is a simple way around it). I have a foreign key constraint set in child tables on a unique field in a parent table. I want to change the unique field expression in the parent table (instead of just one field to make it on two fields). When I try to change the unique index key I get a message that 'the primary key or unique constraint cannot be changed until its existing relationships are deleted.' This means that I have to delete the FK constraints on all child tables; then change this unique key, and then create FK constraints again. Is there a simpler method? TIA.

I think that's the correct way to work this issue and no other methods exist.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform