日期:2014-05-18  浏览次数:20469 次

求一循环插数据的存储过程
我想要对一个INT字段插入连续的数字,连续数字的第一个数需要指定,
而且中间出现的如:100,1000,10000,200,2000,20000,300,3000......
这些数字都不要,这个存储过程怎么写?
主要是怎么判断出这些数字(用正则表达式)?

------解决方案--------------------
学习一下

create procedure sp_123
as
begin
declare @a int
set @a=1
while left(cast(@a as char(10)),3) not in ( '100 ', '200 ', '300 ', '400 ', '500 ', '600 ', '700 ', '800 ', '900 ')
insert into t (int) values (@a)
set @a=@a+1
end
------解决方案--------------------
随机这个知道:
select top 1 List from 表 order by newid()

主题问题不太明白。