TroyMcClure
Technical User
I had asked recently about creating dynamic sql, ie, a string variable with a select statement, then how do I execute that.
I answered my own question by finding the sp_executesql proc.
Now I need to open a cursor using a sql string stored in a variable. I tried
"...cursor local for @sqvariable"
And
"...cursor local for sq_executesql @sqvariable"
and neither works. How would I do this?
Thanks,
T
I answered my own question by finding the sp_executesql proc.
Now I need to open a cursor using a sql string stored in a variable. I tried
"...cursor local for @sqvariable"
And
"...cursor local for sq_executesql @sqvariable"
and neither works. How would I do this?
Thanks,
T