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
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