SQLSERVER 游标
DECLARE @CurCode NVARCHAR(36); DECLARE MyCur CURSOR FOR SELECT [ID] FROM [Table]; OPEN MyCur; FETCH NEXT FROM MyCur INTO @CurCode; WHILE @@FETCH_STATUS=0 BEGIN --你的处理SQL FETCH NEXT FROM MyCur INTO @CurCode; END; CLOSE MyCur; DEALLOCATE MyCur;