• ian.grace (12/20/2010)


    I don't understand how the first transaction could succeed given the attempt to insert the null value into the not-null field "a". Also, why is the last insert of the second transaction, VALUES(2 ,'one'), invalid? Help, I'm confused.

    The first transaction succeeds because it is an explicit transaction. Those will only fail if you explicitly issue a ROLLBACK statement, which isn't the case. Since a COMMIT was issued, the 2 other INSERTS in the transaction are committed to the database.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP