把上面的循环部分改成:
insert into @tb select right('000000'+cast(cast(@counter +1) as varchar),6),lower(left(newid(),6))
set @counter=@counter+1
insert into @tb select right('000000'+cast(cast(@counter +1) as varchar),6),lower(left(newid(),6))
set @counter=@counter+1
insert @tb(b) select lower(left(newid(),6))
from syscolumns a,syscolumns binsert into t_0216user (fuser,fpass)
select right(1000000+id,6),b from @tb
insert into @tb select right('000000'+cast(@counter+1 as varchar),6),lower(left(newid(),6))
set @counter=@counter+1
declare @counter int
set @counter=0
while @counter<1000
begin
set @counter=@counter+1
insert into @tb select right(1000000+@counter,6),lower(left(newid(),6))
end
insert into t_0216user (fuser,fpass) select a,b from @tb
declare @counter int,@id int
select @counter=0,@id=0
while @id<1000
begin
set @counter=@counter+1
if charindex('4',@counter)=0
begin
set @id=@id+1
insert into @tb select right(1000000+@counter,6),lower(left(newid(),6))
end
end
insert into t_0216user (fuser,fpass) select a,b from @tb