简单游标

DECLARE Employee_Cursor CURSOR FOR
SELECT top 20 sal_sales, sales_name,sal_team FROM sal_a_sales where sal_group=16
OPEN Employee_Cursor
FETCH NEXT FROM Employee_Cursor
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM Employee_Cursor
END
CLOSE Employee_Cursor
DEALLOCATE Employee_Cursor

posted @ 2012-11-27 11:06  streetpasser  阅读(104)  评论(0编辑  收藏  举报