DECLARE MyCursor CURSOR
FOR
select instid as instids from TBD_TiJiDuBan
--打开一个游标
OPEN MyCursor2
--循环一个游标
DECLARE @instids int
fetch NEXT from MyCursor2 into @instids
WHILE @@FETCH_STATUS =0
BEGIN
update TBD_TiJiDuBan set AnJianZhuangTai = 'a' where instid = @instids
FETCH NEXT FROM MyCursor2 INTO @instids
END
--关闭游标
CLOSE MyCursor
--释放资源
DEALLOCATE MyCursor