Deleting all object permissions | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Deleting all object permissions

Hi Is there a way/command to delete all the user accounts that have been set up in a database and also to delete all the permissions that have been set on the objects in the same database? Thanks
CE
To delete all users from a specific database, use a cursor to loop through sysusers (where issqluser = 1), calling sp_revokedbaccess with the user name from the cursor. The quickest way to drop all permissions would be to drop and recreate all database roles. You could also heck the REVOKE syntax in BOL for object permissions.
]]>