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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Newbie question - sorry =)

Author  Topic 

Fangfoo
Starting Member

3 Posts

Posted - 2004-10-20 : 17:32:42
I've restored a SQL 2000 db to a new server, restored the specific user accounts, and migrated the dbowner but I still have the defDBName set to a long retired database. Anyone know the select statement to change a users defDBName? Thanks!

As a FYI (these are the bits I used to do the first few steps)

to set a new owner:

sp_changedbowner 'desired-user'

and to find out what the accounts are set at currently:

USE database-name
go
sp_helpdb 'database-name'
go
sp_helpuser
go

and to fix orphaned user:

USE database-name
go
sp_change_users_login 'update_one', 'username' 'password'

sphadke
Yak Posting Veteran

55 Posts

Posted - 2004-10-20 : 17:43:25
This should work for you

EXEC sp_defaultdb 'login', 'databaseName'




Sachin
Go to Top of Page

Fangfoo
Starting Member

3 Posts

Posted - 2004-10-20 : 17:48:30
sweet. Worked like a charm. Thanks.
Go to Top of Page
   

- Advertisement -