问各位一个SQL问题 ???? declare @i int,j intselect @i=max(pno) from tbset @j=1while @j<=@i exec PRO_EMP @jgo 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @count intset @count=1while @count<n begin exec PRO_EMP @count set @count = @count + 1 end declare @count int set @count=1 while @count <n begin exec PRO_EMP @count set @count = @count + 1 end --------------while @count <n 这个N是什么意思? 执行存储过程的时候,是从PNO中取数据,PNO到几,就执行存储过程到几。 改进你的存储过程,把从1到max(PNO)执行的操作写在存储过程里面。存储过程接收一个参数=最大的PNO,然后在存储过程里面,对从1到参数值的PNO进行批处理,最后一次性返回结果。 declare @a int,@b intselect @b=max(pno) from set @a=1while (@a<=@b)begin exec pro_emp @a set @a=@a+1end SQL2005附加数据库出错 发帖遇到的问题 哪一段sql效率高??? 求Sql(列别名,转换等,自认为很难) 新人求助!关于excel中的数据导入到SQL server中的问题 极菜的问题,请高手帮助。 如何设计? 关于一个select 查询,请大力,邹键帮帮我,谢谢@!~~~ 谢存储过程遇到如下问题,急!!! 无法删除表 关于xml 类型数据中批量修改 求简单的sql语句
set @count=1while @count<n
begin
exec PRO_EMP @count
set @count = @count + 1
end
set @count=1 while @count <n
begin
exec PRO_EMP @count
set @count = @count + 1
end --------------while @count <n 这个N是什么意思?
存储过程接收一个参数=最大的PNO,
然后在存储过程里面,对从1到参数值的PNO进行批处理,
最后一次性返回结果。
declare @a int,@b int
select @b=max(pno) from
set @a=1
while (@a<=@b)
begin
exec pro_emp @a
set @a=@a+1
end