Wednesday, November 24, 2010

Generate Random password SQL Server 2008

Well I was transferring users from one table to another and had to add random passwords to the user table.

Could not figure out a way to save my life and then in desperation came up with this methord


SELECT [PERSON_ID]  ,'IAI'+ SUBSTRING(convert(varchar(50),NEWID()),0,6) as password from Persons


Hope the next time I dont spend hours trying to randomize characters and strings :)

1 comment:

Unknown said...

what is this.....