Its not that bad...Declare @numbers table (n int)Insert Into @numbersSelect n = n1+n2+n3+n4+n5+n6+n7From (Select n1=0 Union All Select 1) n1, (Select n2=0 Union All Select 2) n2, (Select n3=0 Union All Select 4) n3, (Select n4=0 Union All Select 8) n4, (Select n5=0 Union All Select 16) n5, (Select n6=0 Union All Select 32) n6, (Select n7=0 Union All Select 64) n7Order By nDeclare @myTable table (pwd varchar(100))Insert Into @myTableSelect 'elw00s(' Union All Select 'steve1'Select pwd, Alphabetics = case when pwd like '%[a-zA-Z]%' then 1 else 0 end, Numerics = case when pwd like '%[0-9]%' then 1 else 0 end, Other = case when pwd like '%[^a-zA-Z0-9]%' then 1 else 0 endFrom @myTableSelect pwd, Alphabetics = sum(Alphabetics), Numerics = sum(Numerics), Other = sum(Other)From ( Select pwd, Alphabetics = case when substring(pwd,n,1) like '[a-zA-Z]' then 1 else 0 end, Numerics = case when substring(pwd,n,1) like '[0-9]' then 1 else 0 end, Other = case when substring(pwd,n,1) like '[^a-zA-Z0-9]' then 1 else 0 end From @myTable A, @numbers B Where B.n <= len(a.pwd) ) ZGroup By pwdCorey
"If the only tool you have is a hammer, the whole world looks like a nail." - Mark Twain