Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved 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: 332 | 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

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones