Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
lemx67
Starting Member
6 Posts |
Posted - 2012-12-12 : 06:20:43
|
How do I cross database servers?I mean, how do I query a table that belongs to a different database in a different database server? I need to do this in a stored procedure.I read somewhere about using spaddlinkedserver, but is there a way to do this using maybe the IP or name of the db server?Thanks for your assistance. |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2012-12-12 : 06:25:06
|
You have to configre the linked server first. Then you can specify ip address/server_name in your query to fetch the data from the remote server.Senthil Kumar C------------------------------------------------------MCITP - Database Administration SQL SERVER 2008MCTS - Database Development SQL SERVER 2008 |
|
|
lemx67
Starting Member
6 Posts |
Posted - 2012-12-12 : 07:06:41
|
Can you do that within the stored procedure?would you kindly give me an example? |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2012-12-12 : 12:43:59
|
Can we know what exactly you are doing? |
|
|
lemx67
Starting Member
6 Posts |
Posted - 2012-12-20 : 22:13:24
|
I am doing a query on some tables on database A, but somewhere along the way I realize that I need the data from another system which uses database B on another server (both SQL Server). I can login to database B and see the data, but I need to do this within a stored prcoedure, and join a table in database B to my queries in database A. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|