Advertisement

04.29.2008 at 03:00AM PDT, ID: 23361460
[x]
Attachment Details

Query Another SQL Server, without Linked Server ?

Asked by cclambie in MS SQL Server, Databases Miscellaneous

Tags: Microsoft, SQL Server, 2000

Hi Experts,

I would like to query a table on another Sql Server within our system.

Similar to this post here...
http://www.experts-exchange.com/Database/MySQL/Q_22458554.html

I am using the correct Syntax I believe, but I can't seem to get across to it?

I am getting this error?
Server: Msg 7202, Level 11, State 2, Line 1
Could not find server 'DbServerNane' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

Do I have to add a linked server? Or just connect using OpenRowSet or some other method?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
SELECT *
FROM DBServerName.DBCatalogName.dbo.calendar
 
 
SELECT *
FROM 
OPENROWSET('SQLOLEDB', 'Server=DBServerName;user_id=Username;password=Pwd;',
     'query=SELECT * FROM DBCatalogName.dbo.calendar')
[+][-]04.29.2008 at 03:03AM PDT, ID: 21460823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 03:11AM PDT, ID: 21460846

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 03:15AM PDT, ID: 21460864

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, Databases Miscellaneous
Tags: Microsoft, SQL Server, 2000
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628