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;

  

posted @ 2015-10-19 15:36  xyzhuzhou  阅读(197)  评论(1编辑  收藏  举报