Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

UDF Random Password Generator

By rrinchuse,

UDF Random Password Generator

You can not use the RAND function directly from a User Defined Function.
So the UDF I wrote "fn_RandomPassword" uses the view "view_RandomPassword8"
to get the random charaters.

Having the random password generator is useful if you need to insert
a large number of users into a table with random passwords assigned.

For example ..

INSERT INTO User_Table
( UserLogin, UserPassword )
SELECT UserLogin, dbo.fn_RandomPassword() as UserPassword
FROM Import_Users_Table

.. all the users from the import table could be inserted
with random passwords very easily.

Total article views: 339 | Views in the last 30 days: 4
 
Related Articles
FORUM

Insert random values

Insert random values

BLOG

Generate Random Passwords using T-SQL

Use following script to generate random Passwords DECLARE @id int,@list varcharSET @list ='abcd...

SCRIPT

Generate a random password

If you ever need a quick way to generate random passwords, this is a pretty useful way to do so.

SCRIPT

Complex Random Password Generator

Generate passwords meeting complexity rules

FORUM
Tags
miscellaneous    
t-sql    
 
Contribute