Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing unique field that has FK
Message
 
 
To
26/06/2012 17:34:32
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01546968
Message ID:
01547006
Views:
32
I know this would be a better choice. But I can't right now. The application is based on the unique keys. I will be refactoring the app step-by-step. Now I need to make it works with current design.
Thank you.

>Use integers as keys.
>
>>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.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform