|
The following
SQL Server T-SQL code sample A+ Markets gourmet food stores demonstrates the usage
of distributed transactions to update the Customers table on the remote Linked Server and on the local server:
USE Northwind
BEGIN DISTRIBUTED TRAN
UPDATE LinkedServerName.Northwind.dbo.Customers
SET CompanyName = 'A+ Markets'
WHERE CustomerID = 'ABCD'
UPDATE Customers
SET CompanyName = 'A+ Markets'
WHERE CustomerID = 'ABCD'
COMMIT TRAN
After execution
the name of the gourmet food chain would be updated on both servers.
|