Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing password

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi

I want to change or reset password for user accessing database, however, even I log in as "sa", I still need the old password from user(s) in order to change for them. Maybe I don't know the right command to change the password. The following is I usually do, is it right?

"sp_password "previouspwd", "newpwd", testuser"

Thanks
 
hello,

try this...

start isql session as sa...
run
sp_password "sa_password","newpwd",testuser

enclose the sa password and new password with quotes only if the password begins with a numeral...

hth,
q.
 
Hi qyllr

It is exactly what I usually do , probably I put the whole thing in the quote that confuses you !! No, I don't want to change "sa" password, just the user's password.

eg: I have a user name "SJohn" and his password is "sjohny"
now he forgets his password and I have to reset for him, here is what I do:

1> sp_password null, newpassword, "SJohn"
2> go

but I will get error, unless I replace "null" with his old password "sjohny" then it will change.

In fact, the only way (well another way) for me to change the password for them (since I don't know their password either) is I have to delete the userid and login and recreate the user login and id again. It's a pain. I want another better way.

Thanks

 
hello,

according to sybase the example i posted should change it for the user you wish to change using the sa or sso account...

the first password parameter which is the caller password... you normally input the old password... since you do not have the user's password you can replace it with the sa or sso password so you can make the change...

let me know if this works for you...

q.
 
Hi qylly

Thanks. I now understand more. Yeah, absolutely it will work if I include sa's password, however, when looking at all users' password, I see the sa's password included (that's not good) for each SQL statement of changing password, I thought it is a default (template) password set up for every user, and the user may change it over the time, which I don't know and I can not use this password.

Now it is clear for me.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top