日期:2014-05-17 浏览次数:20673 次
while 条件 begin ----你的逻辑 end 或用游标 都可以 declare @col1 varchar(32),@col2 varchar(32) declare v_cursor cursor for SELECT col1,col2 FROM tb open v_cursor FETCH NEXT FROM v_cursor into @col1,@col2 while @@FETCH_STATUS = 0 begin ----你的逻辑 FETCH NEXT FROM v_cursor into @col1,@col2 end CLOSE v_cursor DEALLOCATE v_cursor