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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Executing distributed transaction

Author  Topic 

hornet
Yak Posting Veteran

96 Posts

Posted - 2006-06-05 : 03:58:11
Hi all! I have a pair of questions
1. I need to execute about 5 insert/update operations on remote server.
Now I use something like this using Distributed transaction coordinator
BEGIN TRAN
INSERT 1
INSERT 2
SELECT 1
(also here maybe stored procedure)
COMMIT TRAN
But I'm not sure that's right. I think if second INSERT return an error, first INSERT won't be rollbacked.

2. Also I'd like to ask now I use OPENROWSET for work with remote server but i want to use LinkedServer. Where should I set linked server (on remote or local)?
Thanks a lot!

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-05 : 04:19:17
As the statement are in a transaction they will all be rolled back on a roll back.

You create a linked server on the local machine - that's where you will need to be able to reference it.
You would use openquery rather than openrowset for a linked server.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -