DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE
 
 
SITE SEARCH SQLUSA.com VIDEOS
 
 
SQL E/BOOKS   WORLD, USA & SQL NEWS   FORMAT
SCRIPTS SQL 2005 SQL 2008 ARTICLES
How to execute a distributed TRANSACTION?

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.

Related article:

Distributed Transactions

 

Exam Prep 70-461
SQL 2016 DESIGN & PROGRAMMING
 
 
 
DATETIME SELECT SELECT INTO DATE PAD STRING DYNAMIC SQL CURSOR MONEY FORMAT PERCENT STORED PROCEDURE SQL SERVER AGENT JOB OPTIMIZATION WHILE LOOP OVER PARTITION BY UPDATE