Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mrhealy415
Starting Member
2 Posts |
Posted - 2008-01-08 : 18:21:23
|
Thanks in advance for taking time to read this. We just changed over to a new server at work. I detached the main database to copy it over to the new server. Problem is, all the logins on the old server use that db as the default database, except for sa, but nobody here knows the password for sa and it was created before my time. So, I cannot login to the old server. Anybody got any ideas? Thanks again.Brian |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-01-08 : 22:49:19
|
Any other sysadmin login on that server? You can logon as sysadmin and change sa password. By the way, you should be sysadmin on new server I guess. You can do whatever you want. First thing is remapping db user to sql login with sp_change_users_login after attaching db on new server. |
 |
|
mrhealy415
Starting Member
2 Posts |
Posted - 2008-01-09 : 15:50:11
|
there are no other sysadmin logins that dont use the detached db as the default db. I figured out a solution tho, I wrote a vb application which used the odbc to connect to master and run the appropriate stored procedures to change the default db of a login and add sysadmin rights to the login. I was able to get in and get the code out for the jobs I needed to set up. Thanks for your time.Brian |
 |
|
donpolix
Yak Posting Veteran
97 Posts |
Posted - 2008-01-09 : 17:00:20
|
You can also log in thru osql utility then using -D master and -E for trusted connection..once you're in, you can change your default database to an existing database using sp_defaultdb.Donn Policarpio |
 |
|
|
|
|