Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using sp_remotesql to define a cursor.

Status
Not open for further replies.

rblumstein

Programmer
Oct 27, 2003
1
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top