Skip to content


MSSQL 2005 transaction syntax

Simple stored procedure syntax using try catch block and transaction.

create Procedure sp_name
As
  Begin
    BEGIN TRY
      BEGIN TRAN
          --sql query here
        Commit
    END TRY
    BEGIN CATCH
     ROLLBACK TRANSACTION;
    END CATCH
End
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz

Posted in Sql.

Tagged with .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.