I am trying to create a cursor that is uses dynamic SQL however the below procedure is erroring with "variable assignment is not allowed in a cursor declaration."
create procedure loadcode @tabname varchar(50) as
I need to run an IF THEN ELSE insert into another table from the cursors output so how can I create this cursor? And if I was to use a WHILE loop how could it be coded?
Got it to work. For the record you need to declare the whole cursor from within dynamic sql.
answered Dec 03, 2009 at 07:31 AM
David 2 1