Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 retrieve data from other server
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

210 Posts

Posted - 11/08/2012 :  14:41:17  Show Profile  Reply with Quote
Hi All.

I would like to retrieve data from database of other server. If is it possible how to do? For instance, I would like to take data from server database ASdb and table Customers. I tried like

Select *
from [].ASdb.Customers

When I run that select I got error message:
Could not find server '' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.


Edited by - eugz on 11/08/2012 15:40:45

Flowing Fount of Yak Knowledge

5155 Posts

Posted - 11/08/2012 :  16:09:26  Show Profile  Reply with Quote
You need to link the remote server - see here for a description

You can use the following queries to find the linked servers and the logins:
SELECT * FROM sys.servers 
SELECT * FROM sys.linked_logins
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 11/17/2012 :  04:47:29  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Have you tried this?

Select *
from [].ASdb.user_name.Customers


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000