February 22, 2012 at 9:13 am
Hi All,
I need to disable some FKs to execute a delete/partition switch. The problem I'm having is that after I re-enable the key, "Check Existing Data On Creation Or Re-Enabling" option is set to "No" after running the code below.
Can I set that option to Yes without dropping and recreating the key?
ALTER TABLE mytable NOCHECK CONSTRAINT FK_key
delete ....
partition switch
ALTER TABLE mytable CHECK CONSTRAINT FK_key
Thanks
February 22, 2012 at 9:36 am
Hi Lexa,
Try running ALTER TABLE mytable WITH CHECK CHECK CONSTRAINT FK_key
More here... http://www.simple-talk.com/sql/database-administration/foreign-keys-and-their-states/
Cheers
Gaz
February 22, 2012 at 1:42 pm
Gazareth (2/22/2012)
Hi Lexa,Try running ALTER TABLE mytable WITH CHECK CHECK CONSTRAINT FK_key
More here... http://www.simple-talk.com/sql/database-administration/foreign-keys-and-their-states/
Cheers
Gaz
Thanks Gaz
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply