Adding Users after Database Restore I have to restore our production database to a test instance on a daily bases.  This test instance gives people access to the data that we do not want changing production data.  When I restore the database there are logins in the test instance with access to the database that do not have a login or user account in production instance.  So I have a script that goes and adds each user to the users list in the restored database on the test instance.  This list of users changes more than I would like. So I am always making changes to the script.

Does any one know a way to pull a list of instance logins with access to the restored database and add them to the user list of the restored database.  I have to add them with read, write and execute permissions

Thanks
Create a table in your test database with the users that should have access, create a restore script that copies that table into a temp table, do your restore, recreate the table in your test database, use that table to create the appropriate access permissions.