Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    Feb 2005
    Posts
    25

    Question Unanswered: randomly replace all user passwords -Please help

    I have a database where i have a table where i Store every user + their password (not from the database). These are text.

    I want to make a query which rewrites the passwords from the users with randomly generated passwords.

    this is the set-up for the table

    1| : User - text
    2|(key): Lara-Username - text
    3| : Lara-Password - text

    In user is the overal-username stored
    Lara-username is the inlogname for the program
    Lara-Password is the password for the program



    can anyone help me?
    Last edited by Timmieee; 02-08-05 at 10:07.

  2. #2
    Join Date
    Feb 2005
    Posts
    8
    create an new database, then Restore the old db in the new db youve just created. then set the randomly passwords. when restoring an db all passwords are being killed, only "sa" remains.

  3. #3
    Join Date
    Feb 2005
    Posts
    25
    There is no way I can make a button which just replace the passwords instead of creating a new dbase and then restoring the old one in the new one?

  4. #4
    Join Date
    Feb 2005
    Posts
    8
    ive tried that before, but it takes no more than 5 minutes to restore the db. so... mby someone else has an solution. but this is mine

  5. #5
    Join Date
    Feb 2005
    Posts
    25
    thanks, I'm gonna try this then

    But when I've created the new dbase, I have to make up and type the new passwords by myself right?

  6. #6
    Join Date
    Feb 2005
    Posts
    25
    Sorry, I descibed the problem wrong.
    It's not the passwords from the database itself , but i have a table where I register which user has which password. These are just text and I need to make a query that overwrites the passwords with new passwords which are randomly generated

  7. #7
    Join Date
    Feb 2005
    Posts
    8
    that i dont know

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what is the datatype of the password column?

    what formats of random passwords do you want to generate?

    do you have a password-generating function?

    how are the users going to sign in if you replace all their passwords?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  9. #9
    Join Date
    Feb 2005
    Posts
    25
    The data-type is text

    the format are 4 or 5 characters
    i don't have a password-generation function

    and the passwords are for a different application. They are just stored there for administration/registration purpose. We give them an email-notify with their new password.

  10. #10
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    TEXT??!!! you're using a 2-gigabyte field to store a password??????

    you may want to downsize that to something more reasonable, like varchar(937)

    anyhow, try this --
    Code:
    update users
       set pswd = substring(cast(newid() as varchar(64)),4,5)
    no guarantee that they will all be unique, but they should be suitably random
    Last edited by r937; 02-08-05 at 08:29.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  11. #11
    Join Date
    Feb 2005
    Posts
    25
    I get a syntaxis-error when executing the query.

    But i'll explain how the table is set-up.

    1| : User - text
    2|(key): Lara-Username - text
    3| : Lara-Password - text

    In user is the overal-username stored
    Lara-username is the inlogname for the program
    Lara-Password is the password for the program

    the program has no connection to the database. it's acces 2003

  12. #12
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i'm sorry, i cannot help you

    you do realize you posted your question in the sql server forum, right?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  13. #13
    Join Date
    Feb 2005
    Posts
    25
    yes, i do.

    but I couldn't find any section for acces. So i gave it a shot here.

  14. #14
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i'm a forum moderator, i'll move your thread for you
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  15. #15
    Join Date
    Feb 2005
    Posts
    25
    Can anybody help plz?

Posting Permissions

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