-- transaction
begin tran
select * from mylinkedserver.mydb.dbo.tbTable01
commit tran

-- distributed transaction
begin distributed tran
select * from mylinkedserver.mydb.dbo.tbTable01
commit tran

Specifies the start of a Transact-SQL distributed transaction managed by Microsoft Distributed Transaction Coordinator (MS DTC).

Unlike a transaction on a local database, a distributed transaction involves altering data on multiple databases. Consequently, distributed transaction processing is more complicated, because the database must coordinate the committing or rolling back of the changes in a transaction as a self-contained unit.

Sources:

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/begin-distributed-transaction-transact-sql?view=sql-server-ver15

Last modified: September 18, 2020

Author

Comments

Write a Reply or Comment