MS SQL Server BEGIN/END vs BEGIN TRANS/COMMIT/ROLLBACK

Posted by Rich on Stack Overflow See other posts from Stack Overflow or by Rich
Published on 2010-04-28T14:28:42Z Indexed on 2010/04/28 14:33 UTC
Read the original article Hit count: 321

Filed under:
|
|
|

I have been trying to find info on the web about the differences between these statements, and it seems to me they are identical but I can't find confirmation of that or any kind of comparison between the two.

What is the difference between doing this:

BEGIN
    -- Some update, insert, set statements
END

and doing this

BEGIN TRANS
    -- Some update, insert, set statements
COMMIT TRANS

?

Note that there is only the need to rollback in the case of some exception or timeout or other general failure, there would not be a conditional reason to rollback.

© Stack Overflow or respective owner

Related posts about sql

Related posts about begin