Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Dropping all users and roles in a database

Author  Topic 

whizsql
Starting Member

17 Posts

Posted - 2008-12-10 : 15:22:15
I am looking for a script/SQL that would drop all database roles (excluding fixed roles) and users in a database.

I have the drop scripts generated from SSMS 2005 for all database roles & users from test server.I dont think our QA and Prod Servers are mirrored, hence in that scenario test server drop scripts wouldnt work on QA and prod.

Pls help me with some guidelines on creating a generic script(dynamic SQL) so that I can use them across the landscapes without modifications.

Thanks in advance.
   

- Advertisement -