首页 > 数据库 > SQL Server >

sqlserver循环生成连续密码的sql

2013-03-21

sqlserver循环生成连续密码的sql--创建临时表用来存储生成的数据,以免出错create table #tb(passcode varchar(20),useFlag smallint,useResv char(1),cycleTime datetime)declare @maxPasscode intset ...

sqlserver循环生成连续密码的sql
--创建临时表用来存储生成的数据,以免出错
create table #tb(
passcode varchar(20),
useFlag smallint,
useResv char(1),
cycleTime datetime
)
declare @maxPasscode int
set @maxPasscode = 99230091
declare @i int
set @i = 0
while @i < 1000
begin
set @maxPasscode = @maxPasscode + 1
insert into #tb values( @maxPasscode,0,&#39;N&#39;,null)
set @i = @i + 1
end
select * from #tb
insert into summitstorage.dbo.preconfpasscode select * from #tb
drop table #tb
select count(*) from summitStorage.dbo.preconfpasscode where length = 8 and useflag = 0
相关文章
最新文章
热点推荐