Cursor
hi,
i want to know how to create a cursor in SQL SERVER 2000 and print result on the screen.
[97 byte] By [
aneeshjohn] at [2007-11-19 22:36:18]

# 1 Re: Cursor
A way to create a cursor:
DECLARE myCursor CURSOR
FOR
SELECT value FROM table
OPEN myCursor
FETCH NEXT FROM myCursor INTO @myValue
WHILE (@@FETCH_STATUS = 0 ) BEGIN
--DoStuff
FETCH NEXT FROM myCursor INTO @myValue
END
Otherwise, check the documentation/help for SQL Server 2000. It provides pretty much the entier code you need to create/use a cursor.
Alsvha at 2007-11-9 13:43:50 >
