• CELKO (10/20/2014)


    ..SEQUENCEs can "lose" numbers as well: if the transaction rolls back, the acquired sequence number(s) cannot be put back in the pool. If, by law, you can't have any gaps in the assigned numbers, you'll need some other mechanism.

    You use a procedure to save the discarded number then do the ROLLBACK, and finally insert a row for the voided transaction. It is a common idiom to keep the accountants happy -- a major part of IT ;-).

    Maybe, maybe not. Some errors can't be trapped and automatically fail the batch. You certainly couldn't reliably state this was done everywhere in the code it needed to be.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.