Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

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)

Permission scripting over all databases

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.

Telammica

Total article views: 12649 | Views in the last 30 days: 57
 
Related Articles
FORUM

scripting a database without db owner permissions

scripting a database without db owner permissions

FORUM

Scripting Objects Including Permissions

Scripting Objects Including Permissions

FORUM

Versioning database release and permission scripts

How do you version permission scripts

SCRIPT

Retrieve Database Object permission scripts and Role members scripts

I often need to synchronize the user permission between databases. I wrote this simple query to scri...

BLOG

A Script A Day - Day 11 - User Permissions By Database

Today's script will return you permissions granted to a user for every online database.  The script ...

Tags
administration    
databases    
grant    
logins    
permissions    
role    
script    
scripting    
security    
sql server 7    
t-sql    
user    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones