/** 这个用于循环修改表中的字段值 **/
declare @a nvarchar(50),@b uniqueidentifier
declare _codeCursor cursor for
SELECT UnitCode,id FROM RmsOrganization
open _codeCursor
fetch next from _codeCursor into @a, @b
while (@@fetch_status = 0)
begin
update RmsActivity set UnitCode=@a where OrganizationId=@b
fetch next from _codeCursor into @a, @b
end
close _codeCursor
deallocate _codeCursor