I need to insert some data into a remote sql server (linked server), and also lock that table before the insert.
BEGIN TRAN store_tran
--join a remote table and a local table, then insert the result into the remote server.
INSERT INTO #test select ... linkserver.db.dbo.rest with (tablockx) join localtable on ...
insert into linkserver.db.dbo.rest select * from #test;
COMMIT TRAN store_tran
1: is that a distribute transaction? If I use normal table, it is abosultely distribute transaction, but if use temporary table, is it still a distribute transaction?
2: if use temporary variable instead of temporary table (#test) to save the intermediate result, is it distribute transaction?
3: if don't use a temporary place (temp variable, temp table) to store the intermediate, is it a distribute transaction? If there is no tablockx, then it will be a remote transaction but not a distribute transaction, but if use the tablockx, will it change
the nature of the transaction (from non-distribute to distribute). In oracle database, if lock a table using select for update, then there is a bit changed in the table, and if changes some data on remote server, then it problem will be distributed tra
View Complete Post