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)

Script DB Level Permissions v2.1

By S. Kusen,

Hi all,

This updated v2.1 includes a fix for the schema permissions at the DB level.  I hope you continue to find this script as useful as I do.

2.0 Notes:

2.0 is VERY similar to v1 which is posted at

A few fixes were put in based on feedback received by the community. I looped the code with a cursor from a recommendation by William Soranno, and fixed a SCHEMA_NAME() reference per a find by karthik.catchme.

To reiterate the function of the script:

I hadn't been able to locate a script that would give the user role permissions and object-level permissions, so I went through the GUI and used profiler to come up with this script which has worked well for me.

This script can be used directly on any SQL Server 2005/2008 database. It is database-specific, so it won't give output for all DB's on an instance, but I'm sure it could be modified to do so if necessary.

Hope you enjoy!


Total article views: 5984 | Views in the last 30 days: 100
Related Articles

Scripting Objects Including Permissions

Scripting Objects Including Permissions


Stored procedure to script out user permissions

Stored procedure to script out user permissions








Versioning database release and permission scripts

How do you version permission scripts


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

Already a member? Jump in:

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