我现在想写一存储过程,功能是将一张表里的数据取到另外一张表里,
条件是循环的取,[email protected],[email protected] 结束
------解决方案--------------------
create proc up_test1
as
declare @start int
declare @end int
set @start = 0
set @end = 100
while @start <= @end
begin
insert into 表2
select * from 表1
set @start = @start + 20
end
------解决方案--------------------
你怎么写的?
while @start <@end
begin
操作...
set @start=dateadd(minute,20,@start)
end
------解决方案--------------------
[email protected],[email protected] 结束
@start应该是个时间字段
set @start=dateadd(minute,20,@start)
zlp321002(付出最大努力,追求最高成就,享受最佳生活,收获无悔人) 的对.