1

How can I pass Linked server name as a variable?

something like this:

declare @A varchar(55) = 'LinkedServerName'

select * from OPENQUERY(@A,'select 1')
1

1 Answer 1

1

This helped. Here I have to create variable for the whole openquery, and than excute it by dynamic SQL. https://support.microsoft.com/en-us/kb/314520

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.