infutech
asked on
Linked Server Query - Trying to set up an OPENQUERY with a server that is addressed by IP
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,'s elect * from XMCTStatus.dbo.tblTZ')
Error: Line 1: Incorrect syntax near '64.240'.
Can I run this against a server defined with an IP?
select * from OPENQUERY(66.240.29.197,'s
Error: Line 1: Incorrect syntax near '64.240'.
Can I run this against a server defined with an IP?
ASKER
The name is 66.240.29.197.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked like a charm! Thanks.
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 [ ]
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 [ ]
select * from OPENQUERY(MyLinkedServerNa