1

I have a function that returns a table that will need to be called remotely. Since this functionality is not supported by SQL at the moment, I will need to utilize OPENQUERY to do the following

OPENQUERY([Linked_Server],'Query')

However, I keep getting a syntax error when I put in the ip address for the linked server. Linked server is setup properly from the looks of it. I am getting the following error:

Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'OPENQUERY'.

The script is:

OPENQUERY('NN.NNN.N.NN','SELECT * FROM dbo.DBarBillers')

(where N's are the digits of the defined linked server's IP address).

Intellisense is putting the red line under OPENQUERY and the linked server argument

I have tried unquoting the ip address, and bracing it instead of quoting and all are yielding errors. Thoughts?

1 Answer 1

2

You need to select from the openquery so the syntax is

SELECT * FROM OPENQUERY([Linked_Server],'SELECT * FROM dbo.DBarBillers')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.