日期:2014-05-19  浏览次数:20548 次

连续插入号码
数据库表:“电话卡”的结构:如下
卡号(数值型,长度8) 面值(数值型,长度5)

要求:1.已知 ":11000007、11000015、100的,自动把数据插入到“电话卡”中
卡号 面值
11000007 100
11000008 100
11000009 100
11000010 100
11000011 100
11000012 100
11000013 100
11000014 100
11000015 100
2.根据11000007、
要生成卡的张数:9
面值为100的,
自动把数据插入到“电话卡”中

卡号 面值
11000007 100
11000008 100
11000009 100
11000010 100
11000011 100
11000012 100
11000013 100
11000014 100
11000015 100


------解决方案--------------------
晕,没看是数值型.
create procedure protest

@startid numeric,
@endid numeric,
@val numeric,
as
while @startid <endid
begin
insert into table (col1,col2) values(@startid,@val)
set @startid=@startid+1

end