question

kraeg75 avatar image
kraeg75 asked

How is this linked server query processed?

INSERT INTO AccountTransactions (AccountTransactionId, StoreId, AccountTransactionTypeId, AccountId, UserId, Created, CashAmount, EftAmount) SELECT at.* FROM **MYLINKEDSERVER**.MyDatabase.dbo.AccountTransactions at WHERE at.StoreId = 10 AND NOT EXISTS (SELECT * FROM AccountTransactions WHERE AccountTransactionId = at.AccountTransactionId) I'm hoping it'll drag back the AccountTransactions from the linked server before checking if they already exist locally and not send my entire table of AccountTransactions to the linked server for the comparison. Cheers Craig
linked-server
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I believe that it'll pull the records back from the linked server and then filter them out based on the sub-query. If you can get an execution plan it would confirm/deny that.
1 Like 1 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.