3
Reply

2 basic transaction issues

George George

George George

Jan 16 2009 2:24 AM
3.1k

Hello everyone,

Two basic questions about transactions,

1. For single SQL insert/update/delete statement, are there any needs or benefits to wrap into a transaction?

2.  I wrote T-SQL like this,

[Code]
BEGIN TRY
Begin Transaction
...
commit
END TRY
BEGIN CATCH
rollback
...
END CATCH
[/Code]

my question is, is it a must to call commit explicitly just before end try statement? Any means to commit transaction automatically after end try statement?

regards,
George


Answers (3)