defer constraint checking

  • In running an update transaction on a table (not alter table, but update data in the table), I'd like to be able to duplicate oracle's set constraint all deferred/commit structure so that checking isn't done until the commit is executed.  Is there a way to do this?

     

    Thanks

     

  • No, SQL Server does not know the concept of constraint deferability.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • I'm unpleasantly surprised, since this appears to be a basic concept in Informix and Oracle. 

    Can it be simulated, perhaps by turning off particular named constraints, then turning them back on before the commit?  I've seen an article where turning it back on then issuing another select will cause it to recheck the whole table, can anyone confirm this?

    Thanks.

  • Yes, that's a way to achieve somethings similar. Have a look at BOL for ALTER TABLE. Section G. deals with how to disable and reenable a constraint.

    Btw, not everything what other RDBMS can do, is better. Personally I think this "lack" of functionality in SQL Server, is a great help in keeping garbage out of the db.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply