Advertisement

09.21.2007 at 12:48PM PDT, ID: 22845174
[x]
Attachment Details

How to query a SQL Server table via database link

Asked by brooksmato in SQL Server 2005

Tags: , , , ,

Hi,
This is a very basic question. I have a SQL Server 2005 server and have successfully created a dblink to a SQL Server 2000 server. In SSMS I can see all the tables on the 2000 server, but need help with creating a simple select statement. Here is my select statment that does not work:

user master
select * from TEST-GP.[mydatabasename].dbo.[mytablename]

i get this error:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '-'.



Thanks!
Start Free Trial
[+][-]09.21.2007 at 12:49PM PDT, ID: 19938625

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.

 
[+][-]09.21.2007 at 12:50PM PDT, ID: 19938639

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

Zone: SQL Server 2005
Tags: sql, server, dblink, link, database
Sign Up Now!
Solution Provided By: Yveau
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.21.2007 at 12:51PM PDT, ID: 19938642

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.

 
[+][-]09.21.2007 at 01:13PM PDT, ID: 19938807

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.

 
[+][-]09.21.2007 at 01:14PM PDT, ID: 19938821

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.

 
[+][-]09.21.2007 at 01:35PM PDT, ID: 19938983

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628