-
2 basic transaction issues
Hello everyone,
Two basic questions about transactions in SQL Server 2005,
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
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
-
1. Don't need, single sql statement is a transaction.
2. Yes, otherwise the transaction is still open.
-
Cool, rmiao!
Originally Posted by rmiao
1. Don't need, single sql statement is a transaction.
2. Yes, otherwise the transaction is still open.
Question answered.
regards,
George
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|