I am getting an error running the code below. I believe it as to do with the number of single quotes used. How can I set a variable inside OPENQUERY command?
@declare @myStr varchar(6)
set @myStr = 'Test1'
SELECT *
FROM OPENQUERY("192.168.1.1",'SET FMTONLY OFF; EXEC spNewTest @Param1 = ''+ @myStr +''')
Click to see the error message
Regards, Elio Fernandes