Local server is version 10.50.4000
Linked server is 9.0.5000
With the following stored procedure:
Create table #TMP
(
[ID] int NOT NULL,
[SKU] [varchar](50) NOT NULL,
...
)
INSERT INTO #TMP
SELECT
[Siteid]
,[ITEM]
FROM LinkedServer.db.dbo.v_ViewOnLinkedServer WITH (NOLOCK)
PRINT 'Inserted'
DELETE LocalTable
WHERE SKU NOT IN (SELECT SKU FROM #TMP)
The spid on the remote server was killed and the query inserted into the temp table just a third of the records - causing the other 2 thirds to be deleted
What was expected:
The cross sever query should have been an Atomic operation - if part of it failed then all of it should have failed.
We ran many tests over and over (20 +) and got variable results -
most times it retrieves thousands of rows then failed cleanly when the spid was killed.
however about 5% of the time the query returned as if it had read all of its results and continued on with the next stamtet as if nothing happend