Rollback Transaction

Results 1 to 2 of 2

Thread: Rollback Transaction

  1. #1
    Join Date
    Dec 1969

    Default Rollback Transaction

    Can someone give me a syntax example of rollback transaction? I&#039;m using something like this which is off of the MSDN library site:<BR><BR>Begin transaction <BR>Update yada yada yada<BR><BR>If @@error &#060;&#062; 0 <BR>Begin<BR> Select &#039;Unexpected error occurred!&#039;<BR> Rollback transaction<BR> Return 1<BR>End<BR>Commit Transaction<BR><BR><BR>...but it gives me this error:<BR>Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1.<BR><BR>... like it can&#039;t see the rollback or the commit.<BR>Also will this rollback work (once it&#039;s working) if I&#039;m getting a sql timeout error when I run the SP on a ASP page?<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Rollback Transaction

    The code you showed us is perfectly valid code! I think your problem is somewhere else in the SP, or in another SP that calls this SP maybe??<BR><BR>This rollback only handles database errors, not errors on the ASP page, so when a time-out occurs, the transaction will not be rolled back.

Posting Permissions

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