Last active
June 11, 2020 12:13
-
-
Save davipviana/db76434e82b5037472263a5e4be79ae6 to your computer and use it in GitHub Desktop.
SQL script to generate pwd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @char CHAR = '' | |
DECLARE @charI INT = 0 | |
DECLARE @password VARCHAR(100) = '' | |
DECLARE @len INT = 16 -- Length of Password | |
WHILE @len > 0 | |
BEGIN | |
SET @charI = ROUND(RAND()*100,0) | |
SET @char = CHAR(@charI) | |
IF @charI >= 48 AND @charI <= 122 AND @charI <> 59 AND @charI <> 61 AND @charI <> 92 | |
BEGIN | |
SET @password += @char | |
SET @len = @len - 1 | |
END | |
END | |
SELECT @password [Password] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment