Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Distributed Transactions and Linked Servers

$
0
0

I'm somewhat of a novice with SQL Server but I'm learning rapidly from an application I'm developing that uses SQL Server very heavily. In conjunction with the development of this application, I have 3-4 systems set up running SQL Server and I am using those systems to develop the database that will ultimately support the application. I decided to try to use linked servers because I am moving data back-and-forth among the different servers frequently and I ran into some consequences that I wasn't expecting.

I was doing a simple delete query on one of the servers (Delete from TableName Where ...) and I was expecting, of course, that it would only impact the server I was running it on; however, when the query finished after running for a long time, it was apparent that SQL Server had automatically escalated that simple delete query into a distributed transaction and applied it to all four of the linked servers I had defined.  I was totally surprised by that and it took some time to recover the data that was inadvertently lost on the other servers.

I want to ensure that this doesn't happen again without me expecting it - I think the right way to prevent this from happening is to run the following stored procedure:

EXEC sp_serveroption 'servername', 'remote proc transaction promotion', 'false';

Can someone please verify that this assumption is correct and will prevent SQL Server from automatically creating distributed transactions impacting multiple servers?

Thanks,


Chuck



Viewing all articles
Browse latest Browse all 7129

Trending Articles