April 10, 2013 at 7:57 am
In ServerA, I created a linked server to ServerB.
In ServerA, there is a query like below.
select * from [ServerB].order.dbo.allorder where city='london'
Question:
Which server will process data?
1) processing in B and then pass the result to A
2) pass all data in A from B, process in A
April 10, 2013 at 8:51 am
In this scenario Server B processes it, then passes it back to Server A
______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience
April 10, 2013 at 8:57 am
MyDoggieJessie (4/10/2013)
In this scenario Server B processes it, then passes it back to Server A
i believe that's incorrect:
i'm pretty sure this code, Executed on server A would copy the entire table allorder into temp, and then perform the WHERE statement , and then return the results.
select * from [ServerB].order.dbo.allorder where city='london'
this would do the work on ServerB:
EXECUTE ( 'select * from order.dbo.allorder where city=''london'' ' ) AT ServerB;
Lowell
April 10, 2013 at 9:01 am
Is there any way to set up linked server always run in B without this statement?
EXECUTE ( 'select * from order.dbo.allorder where city=''london'' ' ) AT ServerB;
April 10, 2013 at 9:08 am
adonetok (4/10/2013)
Is there any way to set up linked server always run in B without this statement?EXECUTE ( 'select * from order.dbo.allorder where city=''london'' ' ) AT ServerB;
Now that I'm thinking about it, the same command via OPENQUERY would perform at the remote as well: the problem with that is the same as EXECUTE AT: the query has to be hardcoded into a static string, no swapping with a variable like @sqlstatement
SELECT * FROM OPENQUERY( [ServerB],'SET FMTONLY OFF; 'select * from order.dbo.allorder where city=''london''; ')
Lowell
April 10, 2013 at 9:31 am
adonetok (4/10/2013)
In ServerA, I created a linked server to ServerB.In ServerA, there is a query like below.
select * from [ServerB].order.dbo.allorder where city='london'
Question:
Which server will process data?
1) processing in B and then pass the result to A
2) pass all data in A from B, process in A
In addition to EXECUTE AT and OPENQUERY, you also have the REMOTE join hint, to instruct SQL Server to perform the join at the remote.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply