Link to home
Start Free TrialLog in
Avatar of vivekj2004
vivekj2004

asked on

TSQL joining tables on different servers

Can we join 2 tables on two different servers on 2 different databases?
These 2 databases need 2 different connectionStrings for connection.
Avatar of Member_2_861731
Member_2_861731
Flag of Canada image

If you're joining them on a query, then yes.
You'd need a linked server to Server2 and then you can query all the tables in Server2 as follows:

Select * from Server2.myDataBase.owner.myTable

And you can use it to join the tables as well..
Avatar of vivekj2004
vivekj2004

ASKER

what is this linked server. Can I get some sample code or screen-shots (even some link will do), that is good for explaining this.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_861731
Member_2_861731
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Links can be accessed by me also. I was looking for some personal examples, describing remote servers names, how to install drivers and so on.