-- generate 8 digit random alphanumeric number as a initial password
declare
@alpha_numeric varchar(8)
set
@alpha_numeric=''
select
@alpha_numeric=@alpha_numeric+char(n) from
(
select top 8 number as n from master..spt_values
where type='p' and (number between 48 and 57 or number between 65 and 90)
order by newid()
) as t
--select @alpha_numeric
OR
Is there a way with this method to exclude certain characters (I am looking to exclude 1, l, i, 0 and O.
ReplyDelete