How can I pass Linked server name as a variable?
something like this:
declare @A varchar(55) = 'LinkedServerName'
select * from OPENQUERY(@A,'select 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')
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