SQL 游标

DECLARE @RA_Page varchar(50)
DECLARE @RA_ID varchar(50)
DECLARE myCusor CURSOR FOR
SELECT [RA_ID], [RA_Page] FROM Sys_RowAttribute
OPEN myCusor
FETCH NEXT FROM myCusor INTO @RA_ID,@RA_Page
    WHILE @@FETCH_STATUS = 0
    BEGIN
       update Sys_RowAttribute set RA_Use=@RA_Page where RA_ID=@RA_ID
      FETCH NEXT FROM myCusor INTO @RA_ID,@RA_Page
    END
    CLOSE myCusor
 DEALLOCATE myCusor
posted @ 2010-09-06 16:59  张宏宇  阅读(115)  评论(0编辑  收藏  举报