Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
wkm1925
Posting Yak Master
207 Posts |
Posted - 2010-11-07 : 08:26:02
|
Hi,I've 2 server in the different location, which sql1 in 192.168.1.30 and sql2 in 192.168.1.31.These is my scenario.1. I need to update data into sql12. At the same time, i need to insert data into sql2How to make it these 2 transaction (update in sql1 and insert sql2) guaranteed success. In other word, apply atomicity.Need advice on this distributed transaction |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-07 : 09:55:18
|
If the servers are linked:BEGIN TRANUPDATE someTableSET someColumn = someValue;INSERT linkedServer.databaseName.schemaName.tableName (fieldList)VALUES (valueList);IF @@ERROR <> 0BEGIN ROLLBACKENDELSEBEGIN COMMITEND |
|
|
wkm1925
Posting Yak Master
207 Posts |
Posted - 2010-11-07 : 10:18:00
|
Sir,Did you have a good article to setup this Linked Server? |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-07 : 12:45:22
|
http://msdn.microsoft.com/en-us/library/ff772782.aspx#SSMSProcedure |
|
|
wkm1925
Posting Yak Master
207 Posts |
Posted - 2010-11-07 : 19:49:37
|
tq sir |
|
|
|
|
|