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 table
參考來源
http://stackoverflow.com/questions/15038311/sql-password-generator-8-characters-upper-and-lower-and-include-a-number
沒有留言:
張貼留言