Results 1 to 2 of 2

Thread: rollback of sp calling another sp

  1. #1
    Join Date
    Nov 2002
    Posts
    261

    rollback of sp calling another sp

    If you have a begin tran in a sp that calls another sp and that called sp fails. can you execute a roll back from the called sp, or should it return and error which will roll back the begin tran in the original sp

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Yes you can call ROLLBACK in called sp. You have to remember that no matter how many begin tran you have issued, ROLLBACK rollsback every thing. This is in contrast to COMMIT, which commits the inner most level only.

    Look for "nested transactions" in BOL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •