DECALRE [cursorname] CURSOR FOR
[ SqlQuery]
OPEN [cursorname]
FETCH NEXT FROM [curorname]
WHERE CURRENT OF [curorname]
CLOSE [curorname]
DEALLOCATE [curorname]
Examples
DECALRE [abc] CURSOR FOR
[ UPDATE Tree SET
[Level] = @ToLevel+1,
[OrderCode]= @ToOrderCode]
OPEN [abc]
FETCH NEXT FROM [abc]
WHERE CURRENT OF [abc]
CLOSE [abc]
DEALLOCATE [abc]