|
DECLARE pivot_Cursor CURSOR FOR
select a, b from pivot--This is the result set to be traversed with the cursor
OPEN pivot_Cursor
FETCH NEXT FROM pivot_Cursor into @a,@b--This is to get the first record, and assign the record column to the variable
WHILE @@FETCH_STATUS = 0--This is to determine whether there is any data behind
BEGIN
...--This is dealing with
FETCH NEXT FROM pivot_Cursor into @a--this is the next record
END
CLOSE pivot_Cursor
DEALLOCATE pivot_Cursor |
|