By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,766 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,766 IT Pros & Developers. It's quick & easy.

Unable to join 2 tables which are in 2 differenet servers

P: 5
Hi all,

I am trying to get the data from 2 tables which are in 2 different servers , to get that i have used
"sp_addlinkedserver" .Using this I am able to connect to the server also .I have used the following commands

for example my server ip is 11.12.23.121

EXEC sp_addlinkedserver '11.12.23.121'
EXEC sp_addlinkedsrvlogin @rmtsrvname = '11.12.23.121'

after this I am not bale to get the results of the linked server using following query

select * from '11.12.23.121'.testdb.dbo.userreg

Please tell me how to get the data from the linked server.

Thanks in advance
Nov 6 '09 #1
Share this Question
Share on Google+
2 Replies


ck9663
Expert 2.5K+
P: 2,878
Try:
Expand|Select|Wrap|Line Numbers
  1.  
  2. select * from [11.12.23.121].testdb.dbo.userreg
  3.  
  4.  
What error did you get?

Good luck!!!

--- CK
Nov 6 '09 #2

P: 5
Hi ,

Thank you for your reply ,

I have tried to get the data as said by you but I ma getting the following error

"OLE DB provider "SQLNCLI" for linked server "[server]" returned message "Login timeout expired".
OLE DB provider "SQLNCLI" for linked server "[server]" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53]. "


can you please tell me how to get rid of this.

Thank you
Nov 7 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.