Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By W Louw,
This stored procedure is helpful in scripting permissions for a user in all databases it exist in.
If @newuidname has a value of '', it will scroll all databases and search for its permissions.
If @newuidname has a valid username, it will only script out the permissions for @uidname where @newuidname does not already have the same permissions or roles assigned.
If @RolePermissions = 1 the permissions of the roles @uidname belong to will also be scripted.
I initially used sp_helprotect, but then I had to do it database by database individually, this way I can run it once for all. This sp can be compiled on any database and it will still go through all databases.
Hope it is useful.
scripting a database without db owner permissions
Script database and object level permissions for all database users
Scripting Objects Including Permissions
How do you version permission scripts
I often need to synchronize the user permission between databases. I wrote this simple query to scri...