What is difference between tran
and transaction
in SQL Server 2005 ?
Following are two statements
Begin Tran Begin ......... ......... End Rollback
OR
Begin Transaction Begin ...... ...... End Rollback
BEGIN TRANSACTION represents a point at which the data referenced by a connection is logically and physically consistent. If errors are encountered, all data modifications made after the BEGIN TRANSACTION can be rolled back to return the data to this known state of consistency.
The COMMIT command is the transactional command used to save changes invoked by a transaction to the database. The COMMIT command saves all the transactions to the database since the last COMMIT or ROLLBACK command.
SQL Server can operate 3 different transactions modes and these are: Auto-commit transactions. Implicit transactions. Explicit transactions.
There is no difference. TRAN
is merely an allowed abbreviation, as can be seen from the documentation:
Syntax
BEGIN { TRAN | TRANSACTION } [ { transaction_name | @tran_name_variable } [ WITH MARK [ 'description' ] ] ] [ ; ]
The { | }
in this syntax description means 'pick one of these two alternatives'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With