Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    12

    Talking Unanswered: Generate a unique alphanumeric password

    Hi There!


    Does anybody know how to generate unique alphanumeric passwords in SQLServer?


    You help will be very much appreciated






    Mel!

  2. #2
    Join Date
    Oct 2003
    Location
    Belgium
    Posts
    4

    Re: Generate a unique alphanumeric password

    Hello,

    I don't think it is possible in SQLServer.
    You can try:
    http://www.burney.ws/software/demos/password_generator/

    Kind regards,

    Jan

  3. #3
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    45

    Re: Generate a unique alphanumeric password

    Originally posted by melaniemayfield
    Does anybody know how to generate unique alphanumeric passwords in SQLServer?
    I guess you don't think GUID is a nice password? ;-)

    Just using RAND you can create some random passwords like this...

    DECLARE @PwdLen SMALLINT,
    @Chr TINYINT,
    @Password VARCHAR(20)

    -- Seed
    SET @Chr = RAND(DATEPART(ms, GETDATE())) * 0
    SET @Password = ''

    SET @PwdLen = 1
    WHILE @PwdLen < 8
    BEGIN
    SET @Chr = RAND() * 62
    SET @Password = @Password + CHAR(
    CASE WHEN @Chr < 10 THEN @Chr + 48
    WHEN @Chr BETWEEN 10 AND 35 THEN @Chr + 55
    ELSE @Chr + 61
    END)

    SET @PwdLen = @PwdLen + 1
    END

    SELECT @Password [Password]


    Perhaps can get you something to work from.

    Cheers,
    Robert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •