I have a SQL 2005 Express database with security configured for Windows authentication on my development machine. Occasionally I need to copy it to a SQL 2008 R2 test server that uses SQL authentication. I’ve tried detaching and attaching the development copy on the test server, as well as restoring a development backup on the test server, but in both cases the SQL account’s role membership and permissions that I had configured previously are lost and I have to reconfigure them.
Is there a way to copy the database to the test server and keep the existing SQL user security configuration intact after restore/attach?
Thanks!
Sure:
The SSMS GUI has a quick’n’dirty way to copy users: , Tasks, Generate scripts …., select “users”.
Here’s another alternative:
http://support.microsoft.com/default.aspx?scid=kb;en-us;246133