请高手指点取得一个范围内的随机书
smdy 2006-11-02 10:22:54 我写的循环 但需要得到符合要求的随机数 高手看看怎么补
declare @inti int,
@namelength int ,
@strNew char (100),
@strA char (40)
select @inti = 0,
@strA = '0123456789abcdefghigklmnopqrstuvwxyz',
@namelength = rand ()-- 需要一个1--100的随机数 做为name的长度
while (@inti < @namelength)
begin
set @strNew ='"+ @strNew + substring(@strA, rand (),1)+ "' -- 在侯选的36个字符中随机截取一个字符,需要<=36的随机数
set @inti =@inti +1
end
还望高手指教啊