Link to home
Start Free TrialLog in
Avatar of bbonner
bbonnerFlag for United States of America

asked on

SQL 2012 database restore problem

We are restoring a database sent by one of our customers to a different SQL server at our location.  The database backup works fine but the application requires logins that are part of the database also.  When we restore, all the users are there with their security but no logins are restored.  I can go in and recreate each login and manually add security for each user but that is not practical for over 100 users.  Is there an easier way to get the logins with all of the security without manually adding each one?

The database is from the customers production database and we want to restore it to a clean SQL 2012 server to see if we can replicate a problem several of their users are experiencing.  Their is no way to go to the customer site as it requires classified access.  This database is not classified.
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By writing stored procedure Script you might able to do it. you could get the script from Microsoft here . This will create a stored procedure script which will transfer all logins including password. Other methods are time consuming.
@ Jason clark-

I have already provided the same link in the first comment.
Avatar of bbonner

ASKER

I see that this will create the login and original password but will it also create the security settings for each login that shows up for each user?  Each user has different security settings.
Could you please tell me what changes you require in the script?
Avatar of bbonner

ASKER

The script creates the user and the login in the database but it does not set the security settings for the logins.  I setup the security manually and it works.  Your solution gave us the information we needed to resolve the issue but it would be nice to have the script add the security also.  I am going to close this issue for now and give you full credit.  Thanks!