March 2001
Intermediate to advanced
640 pages
14h 9m
English
You used BEGIN TRANSACTION, COMMIT TRANSACTION, and ROLLBACK TRANSACTION in batches throughout yesterday's lesson on locking. You should have a pretty good idea what they do at this point. This section will present the transaction control statements more formally, and then we'll look at transaction nesting and transaction modes.
SQL Server supports four transaction control statements. (You can use the words TRANSACTION and TRAN interchangeably.)
BEGIN TRANSACTION—Starts a transaction block. Locks are held from this point forward. Optionally, name the transaction, like this:
begin transaction my_tran
COMMIT TRANSACTION—Ends a transaction block. Work is completed and written to ...
Read now
Unlock full access