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)
 Restoring permissions after DB restore

Author  Topic 

vaddi
Posting Yak Master

145 Posts

Posted - 2006-10-22 : 14:57:00
Hello,

How can i restore the permissions of the users when I restore a database on the test server from a production server.

I am able to synch the user id's but not getting the permissions.
How can I go about this.

Thanks

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2006-10-22 : 15:19:49
use sp_help_revlogin

for SQL 7/2000 http://support.microsoft.com/kb/246133
for SQL 2005 http://support.microsoft.com/kb/918992

Derrick Leggett modified the SQL2000 script to also set the default database for a given login. Search the forums here for his modified version.



-ec
Go to Top of Page

vaddi
Posting Yak Master

145 Posts

Posted - 2006-10-22 : 16:21:10
Hello ,

Thanks for the links.

I got a doubt , how to create the login names for those users.
Is there any script that , automcatically creates the logins.

Thanks
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2006-10-22 : 16:52:29
quote:
Originally posted by vaddi

Hello ,

Thanks for the links.

I got a doubt , how to create the login names for those users.
Is there any script that , automcatically creates the logins.

Thanks





that is what the script does.
Go to Top of Page

vaddi
Posting Yak Master

145 Posts

Posted - 2006-10-22 : 21:35:50
Hello

After I execute the : EXEC master..sp_help_revlogin
which is supposed to create the logins.

I see the sp_helpuser , but I donot see any login entries onthe database that I have restored.

When the use sp_helpuser , on the other DB's I see the login entries.

So what should I do.

Thanks
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2006-10-22 : 22:00:30
did you read the articles I linked to? You run the script on the source system that has the logins/permissions you would like ot duplicate. It then generates commands that you copy/paste and run in the destination system.



-ec
Go to Top of Page
   

- Advertisement -