Randomly generate password in SQL Server 2008

There are lots of ways of generating random strings in SQL Server. But instead of spending much time on finding solution to random password generation, here is an easy way to do that.

SELECT SUBSTRING(convert(varchar(50),NEWID()),0,8) as password

This generates 8 characters long  password which is a random string.

Some results:-

673CB61

6BD26C7

7F5F1EB

SHARE Randomly generate password in SQL Server 2008

You may also like...

1 Response

  1. Sebastian says:

    SELECT LEFT(NEWID(), 8)

Leave a Reply

Your email address will not be published.

Share