Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Password Generator - 8 characters, upper and lower and include a number [closed]

I need to create a new password in TSQL which needs to be 8 characters (a-z) which have to include upper and lower characters as well as at least one number.

Can anyone help me with this?

like image 666
DotNet Avatar asked Nov 28 '22 01:11

DotNet


1 Answers

select cast((Abs(Checksum(NewId()))%10) as varchar(1)) + 
       char(ascii('a')+(Abs(Checksum(NewId()))%25)) +
       char(ascii('A')+(Abs(Checksum(NewId()))%25)) +
       left(newid(),5)
from yourTable
like image 175
Grisha Weintraub Avatar answered Dec 18 '22 20:12

Grisha Weintraub