Good afternoon... I am trying to see if anyone has a script that I could run before restoring a database that would generate the SQL to be run after the restore that would create all the database level security as well as any server level (View Definition, Show Plan, etc.) that an account may have.
We are often asked to restore DB's from one environment to another and the security between the two environments is different. I have a script that works okay now, but it is missing the security like ViewDefinition, ShowPlan, etc.
This would need to be able to run on SQL 2005 sp3 or newer and just be TSQL.
Thanks in advance