Re: Getting the sa password with SQLDMO
From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 12/27/04
- Next message: David Gugick: "Re: confusing transactions with sqldmo"
- Previous message: Otis: "Getting the sa password with SQLDMO"
- In reply to: Otis: "Getting the sa password with SQLDMO"
- Next in thread: Otis: "Thanks"
- Reply: Otis: "Thanks"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 26 Dec 2004 23:09:47 -0600
SQL Server stores passwords using a one-way hash so you can't read the
existing password into a clear text string. You could accomplish the
conditional password change by attempting a connection using the expected sa
password and, if it fails, connect using a different sysadmin role member
login to change the password as desired.
However, the need for such a script strikes me as odd. Only sysadmin role
member can change the sa password. I would hope that your sysadmin role
members don't change the sa password indiscriminately.
-- Happy Holidays Dan Guzman SQL Server MVP "Otis" <stephenprescott.TAKEOUTSPAM.@msn.com> wrote in message news:eDTHw%2386EHA.208@TK2MSFTNGP12.phx.gbl... > Hi, > > I have a failsafe routine that checks the sa password to make sure that it > has not been changed. I can reset it like this: > > If objLogin.Name = "sa" Then objLogin.SetPassword vbNullString, > "Somepassword" > > But it seems a little sloppy to be setting this password again and again > when it never changes. Is there a way to discover the password with SQLDMO > so I can see if it has changed before I go setting it again? > > Thanks. > > Steve > >
- Next message: David Gugick: "Re: confusing transactions with sqldmo"
- Previous message: Otis: "Getting the sa password with SQLDMO"
- In reply to: Otis: "Getting the sa password with SQLDMO"
- Next in thread: Otis: "Thanks"
- Reply: Otis: "Thanks"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|