Defered Constraint Checking
We often need to reload application tables, such as configuration, enumeration values etc which we do via a bulk insert from application generated export. When foriegn key constraints are added against these tables deleting and reloading data results in constraint violation. Since an alter statement cannot be placed in the same batch the process constraint disable/reenable cannot be performed within the context of the transaction to ensure constraint is reenabled if the data reload fails.
Upvotes: 6<=-=Jul 9 2007 12:51PM=-=>
Thanks for your valuable feedback and sorry for the late answer. As you might have seen in the community discussion comment of your submission, there is a related suggestion about the same issue. We are planning to implement this feature in our next major release. This other suggestion also includes a possible workaround, see https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=124624
With best regards,
I have resolved your request as duplciate of feedback item below:
Umachandar, SQL Programmability Team
Matthias Kurz commented
Are there plans to implement this?