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 HEADLINES NEWS
SQL E/BOOKS   SQL 2014 PROGRAMMING   DOWNLOADS
SCRIPTS SQL 2005 SQL 2008 ARTICLES
SQL JOBS TWITTER FORMAT VIDEOS
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
Exam 70-461
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