declare @password varchar(8)
select @password=@password+char(n) from
select top 8 number as n from master..spt_values
where type='p' and number between 48 and 122
order by newid()
) as t
Here, The logic is taking top 8 numbers randomly and then converting randomly generated number to euivalent character code by using CHAR(n) function...