Running queries against multiple servers?
I am not sure what the best design pattern for this problem is so any suggestions would be greatly appreciated. I have two SQL Servers A
(with DBs P,Q,R) and B
(with DBs X,Y,Z).
What is an efficient way to do a join of tables situated on开发者_如何学Go Server A
with those on Server B
from command-line? Basically, I am trying to automate a long running list of queries and am not really sure how to proceed.
EDIT: I do not have control over the servers and am not an admin.
At a minimum I would create a Link Server between the two servers. Using something like OPENROWSET will be slower than using a Link Server.
Depending on how fast you need these queries to run you might consider having a nightly process that copies the data from Server A to Server b (or the other way around) so that you don't need to worry about cross server.
There is no way of performing a join across different servers. You can either use a cluster solution on top of those servers to do it for you, or you can do it by yourself - reading from one table, and performing the join manually in your code.
精彩评论