语法:
BEGIN TRAN[SACTION] [transaction_name | @tran_name_variable]
例如
BEGIN TRAN
-- 做某些操作,例如Insert into …
if @@error <> 0
BEGIN
ROLLBACK TRAN
END
else
COMMIT TRAN