Groups | Blog | Home
all groups > sql server msde > may 2005 >

sql server msde : Reset Forgotten MSDE Password


Hari Prasad
5/4/2005 12:00:00 AM
Hi,

Login into MSDE using trunsted connection and change the default db for the
user

OSQL -E -S Servername (enter)

Now change the default db for the use

sp_defaultdb (see books online for details)

Now change the password for user using SP_password command

Thanks
Hari
SQL Server MVP

[quoted text, click to view]

Jacco Schalkwijk
5/4/2005 12:00:00 AM
If the account you login with is an administrator on the local machine, you
can use the osql command line tool to execute the sp_password stored
procedure:

osql -E -Q "EXEC sp_password @new='newpassword', @loginame = 'sa'"

That's not a spelling mistake in loginame. Apperently long, long ago when
the sp_password procedure was created bytes were really expensive and
someone decided to save some on that extra n. <g>

--
Jacco Schalkwijk
SQL Server MVP


[quoted text, click to view]

Marcus
5/4/2005 12:01:03 PM
I have forgotten the SA password for my MSDE install. Can some one please
Marcus
5/4/2005 1:38:02 PM
When I run that command, I get the following error: "Cannot open user default
database. Login failed." Thanks for the help.

[quoted text, click to view]
Jacco Schalkwijk
5/5/2005 12:00:00 AM
Specify the database explicitly:

osql -E -d master -Q "EXEC sp_password @new='newpassword', @loginame = 'sa'"

--
Jacco Schalkwijk
SQL Server MVP


[quoted text, click to view]

Marcus
5/5/2005 9:54:01 AM
I am logged into the server using an administrator account, however, when I
try to run the initial OSQL command you suggest, I get the same: "Cannot open
user default database. Login failed." Thanks for your help.

[quoted text, click to view]
Marcus
5/6/2005 6:46:05 AM
That did the trick! Thanks for everyone's help :)

[quoted text, click to view]
AddThis Social Bookmark Button