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 2005 Forums
 Transact-SQL (2005)
 login permission after restore

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2009-04-02 : 07:25:33
I have restored a database.
There is a system stored procedure which should be run to restore these logins with proper permissions.
I think it is sp_fix... or sp_repair... which requires the user account to be passed to it.
Do you know the name of the stored procedure and the proper parameters please?
Thanks

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-04-02 : 09:49:59
Resolve Orphaned Users

Use TestDB
--to fix individual logins
sp_change_users_login 'update_one', 'test', 'test'
--to automatically fix logins with same name
sp_change_users_login 'Auto_Fix'
--report logins not listed in masterdatabase
sp_change_users_login 'Report'
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-04-02 : 09:53:04
If you have restored to a new server you may need to copy login passwords across. Search google for: sp_help_revlogin
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2009-04-03 : 02:44:35
quote:
Originally posted by darkdusky

Resolve Orphaned Users

Use TestDB
--to fix individual logins
sp_change_users_login 'update_one', 'test', 'test'
--to automatically fix logins with same name
sp_change_users_login 'Auto_Fix'
--report logins not listed in masterdatabase
sp_change_users_login 'Report'



Thank you
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-04-03 : 04:42:14
welcome
Go to Top of Page
   

- Advertisement -