lazyrunner50
Programmer
I am using a cursor at the top of a *.sql file to loop through the records of a table, and am inserting these values into a temporary table which I am using within the loop. While I am within this loop, I move through the records in the table to try to match up the current value with the one from the outer table. Anyways, I am having a problem with this inner loop. I am trying to use a cursor to move through the table, but I keep getting the error "DECLARE CURSOR must be the only statement in a query batch". Does anyone know what this means, how to solve it, or how to avoid it entirely by not using a cursor?
Thanks in advance!
Thanks in advance!