Creating a random password using dictionary table


/ Published in: SQL
Save to your folder(s)

Create a random password using a Dictionary database table.
Selects a random word, and then appends two random numbers to the end, creating passwords in the form of: foozling98 or laicism11


Copy this code and paste it in your HTML
  1. SELECT Top 1 word + CAST(CAST((RAND() * 9)+1 AS INT) AS VARCHAR(3)) + CAST(CAST((RAND() * 9)+1 AS INT) AS VARCHAR(2)) AS Password FROM dictionary ORDER BY newid()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.