Wikis > SQL Wiki > CURSOR
DECLARE @Cursor_Text varchar(255)

DECLARE Cursor_1 CURSOR LOCAL STATIC READ_ONLY FOR
        SELECT [Text]
        FROM Table

OPEN Cursor_1
FETCH NEXT FROM Cursor_1
INTO @Cursor_Text

WHILE @@FETCH_STATUS = 0
BEGIN



   FETCH NEXT FROM Cursor_1
   INTO @Cursor_Text
END

CLOSE Cursor_1
DEALLOCATE Cursor_1
Category: Tags: