-- Declare cursor
DECLARE cursor_name CURSOR FOR
SELECT ... FROM table_name
-- Open cursor
OPEN cursor_name
FETCH NEXT FROM cursor_name
-- Loop From Cursor
WHILE (@@FETCH_STATUS = 0)
BEGIN
FETCH NEXT FROM cursor_name -- Fetch next cursor
INTO ....
END
-- Close cursor
CLOSE cursor_customer;
DEALLOCATE cursor_customer;
DECLARE @pcno int
DECLARE @currentpoint int
DECLARE uppoint CURSOR FOR SELECT cPcNo,cWB FROM C9World.Game.TblPcInfo WHERE cPcNo > 0
OPEN uppoint
FETCH NEXT FROM uppoint
INTO @pcno,@currentpoint;
WHILE (@@FETCH_STATUS = 0)
BEGIN
UPDATE C9World.Game.TblPcInfo SET cWB = @currentpoint+@point WHERE cPcNo = @pcno
FETCH NEXT FROM uppoint
INTO @pcno,@currentpoint;
END