sql怎么跳出循环?为什么我这里的return不管用? 我写的程序如下: declare @k int set @k=1 declare @RK varchar(100) set @RK='r'+cast(@k as varchar(100)) declare @break varchar(10) set @break='0'
declare @RKNotEmpty varchar(100) set @RKNotEmpty='if exists(select * from '+@RK+') return'
while 1=1 begin print @RKNotEmpty exec(@RKNotEmpty) end