Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I was recently tasked with moving some databases to a new server. I created backups then restored the databases to the new server and it looks like the database users were retained, however there's no corresponding logins, prohibiting the users from accessing the new server. All of the users are domain users. Is there any way to iterate over the existing users in a database and create a login for each?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Google for sp_help_revlogin and find the version for your version of SQL (the SQL 2008 version works on SQL 2008 and up). Install this sp on the old server. Run sp_help_revlogin on the old server. Take the output and put it in a query window on the new server, and run the query to create all the logins.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.