Skip to content

Instantly share code, notes, and snippets.

@somendra007
Created March 27, 2022 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somendra007/aca5c177026b198c9d31490ecc1f7f02 to your computer and use it in GitHub Desktop.
Save somendra007/aca5c177026b198c9d31490ecc1f7f02 to your computer and use it in GitHub Desktop.
Generate Password view in sql server
------------------------------------------------------------------
CREATED BY : SOMENDRA PRATAP SINGH
PURPOSE : Generate random password
SELECT RandomPassword from generateRandomPassword
------------------------------------------------------------------
*/
CREATE VIEW generateRandomPassword
AS
SELECT CHAR((RAND() * 25) + 97) + CHAR((RAND() * 25) + 97) + CHAR((RAND() * 25) + 97) + CAST(CAST((RAND()*9999) AS INT) AS VARCHAR(4)) as RandomPassword;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment