rblumstein
Programmer
I'm trying to use a query defined by macro substitution with the sp_remotesql function. I tried:
DECLARE cursor_name CURSOR FOR
EXEC sp_remotesql local, @sSQL1, @sSQL2,...
However I always get the compile error:
Msg 156, Level 15, State 1:
Incorrect syntax near the keyword 'exec'.
How can I get this query into a cursor?
Do I have to store it in a table?
DECLARE cursor_name CURSOR FOR
EXEC sp_remotesql local, @sSQL1, @sSQL2,...
However I always get the compile error:
Msg 156, Level 15, State 1:
Incorrect syntax near the keyword 'exec'.
How can I get this query into a cursor?
Do I have to store it in a table?