Is it possible to defer referential integrity checks until the end of a transaction in SQL Server?
I recently read in Fowler's PofEA that some database engines allow you to defer RI checks until the end of the transaction. Is this possible in SQL Server? The problem comes with some scenarios where I am trying to save changes that include insertions and deletions, it can be tricky to determine the correct order in which to perform the operations to avoid RI failures. I know that at the end of the transaction the RI will be good so it would seem ideal to defer these checks. Looks like sql server doesn't allow this, but you aren't the only one who wants it. It's part of the SQL 92 standard, so