SQL Server prohibits automatic commit transactions of Management Studio

Time:2021-11-24

Auto commit transaction

The default Management Studio is to automatically commit transactions, that is, one transaction per statement.

Implicit transaction

Open SQL Server Manager studio and log in to the instance.
Tools -> Options
Query Execution -> SQL Server -> ANSI

Set implicit_ Tick before transactions
In this way, when a transaction ends, a new statement will automatically start a new transaction. This is an implicit transaction. Finally, the transaction ends through our commit or rollback.

Explicit transaction

begin transaction
delete from erpdb.dbo.mtl_categories_b
rollback transaction
–commit transaction

Recommended Today

Seven solutions for distributed transactions

1、 What is distributed transaction Distributed transaction means that transaction participants, transaction supporting servers, resource servers and transaction managers are located on different nodes of different distributed systems. A large operation is completed by more than n small operations. These small operations are distributed on different services. For these operations, either all of them are […]