Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linked Server Query - Trying to set up an OPENQUERY with a server that is addressed by IP

Posted on 2004-10-28
5
Medium Priority
?
344 Views
Last Modified: 2006-11-17
I have set up a linked server within enterprise manager. When I try to run the statement below in SQL Query Analyzer I recieve an error:
select * from OPENQUERY(66.240.29.197,'select * from XMCTStatus.dbo.tblTZ')
Error: Line 1: Incorrect syntax near '64.240'.

Can I run this against a server defined with an IP?
0
Comment
Question by:infutech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:ShogunWade
ID: 12434876
what is the name of your linked server?


select * from OPENQUERY(MyLinkedServerName,'select * from XMCTStatus.dbo.tblTZ')
0
 

Author Comment

by:infutech
ID: 12434932
The name is 66.240.29.197.  
0
 
LVL 18

Accepted Solution

by:
ShogunWade earned 2000 total points
ID: 12434952
try this:

select * from OPENQUERY([66.240.29.197],'select * from XMCTStatus.dbo.tblTZ')
0
 

Author Comment

by:infutech
ID: 12435086
Worked like a charm! Thanks.
0
 
LVL 18

Expert Comment

by:ShogunWade
ID: 12435130
your welcome.

Basically the issue was that the linked server name in the openquery statement is defined as a sysname datatype.  sysname types containing white space or punctuation must be enclosed in  [ ]
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question