日期:2014-05-17 浏览次数:20787 次
declare @v1 varchar(2000) declare curtable1 cursor for select v1 from table1 open curtable1 fetch next from curtable1 into @v1 while @@fetch_status = 0 begin exec(@v1) fetch next from curtable1 into @v1 end close curtable1 deallocate curtable1