Difference between Implicit and Explicit Transaction

后端 未结 4 1922
长情又很酷
长情又很酷 2020-12-09 10:06

What is the difference between Implicit and Explicit transaction in Sql Server 2008?

What happens in TransactionScope background? I\'m using TransactionScope but in

4条回答
  •  暖寄归人
    2020-12-09 10:18

    In Explicit transaction mode, you will need to start a transaction explicitly. In Implicit transaction mode, a transaction is automatically started after each commit. So you will only have to commit.

    Since the transaction is started 'implicitly', you will not see an explicit 'BEGIN' in the logs. :)

    By default the database operates in explicit transaction mode with autocommiting transactions enabled. That actually meand that unless an explicit transaction is started using BEGIN TRANSACTION, every data modification is started in a separate transaction which is committed after the statement. That allows the database to rollback an entire statement when it fails (for instance a bulk insert, or an insert that modifies other data in a trigger).

提交回复
热议问题