February 8, 2012 at 4:17 am
Hi
im looking at a piece of code that randomly fails
it goes along the line of something like
While Something
BEGIN
Begin Trasnaction
Insert Into Table
Commit
END
Firstly i have added the rollback on the @@ERROR check , but im wodering if there is any differance between calling Commit and Commit Transction
Regards
Clayton.
February 8, 2012 at 4:22 am
No. The word TRANSACTION is optional after COMMIT or ROLLBACK.
Don't add @@error, add a try-catch construct.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 8, 2012 at 4:30 am
Thanks alot
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy