11
I'm using a cursor.
DECLARE @column1 NVARCHAR(MAX);
DECLARE cursor_name CURSOR FOR
SELECT c1
FROM table_name;
OPEN cursor_name;
FETCH cursor_name INTO @column1;
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH cursor_name INTO @column1;
END
CLOSE cursor_name;
DEALLOCATE cursor_name;
Now my question is, can I change the cursor cursor_name's definition after using it? I mean something similar to:
DECLARE cursor_name CURSOR FOR
SELECT c2
FROM table_name2;
Using the same cursor name cursor_name, but the defination is changed.
If this is possible, how to do this?
Thanks.