SQL Clone
SQLServerCentral is supported by Redgate
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)

Database Users And Associated Database Roles

By Larry Sumuri,

1. Copy the script over to you SQL Query Window

2.Replace the name of the database, that is, '<databasename>' with the name of the database to run against

3. Execute the script to view the resultset displaying that database's users and thier associated database roles

Note: The script works on SQl Server 2005, and has not been tested against SQL Server 2008 yet.

Total article views: 3401 | Views in the last 30 days: 1
Related Articles

I need script related to databases

glnp scripts on database


Generate scripts for all databases

Generate scripts for all databases


Scripting Remote Database using SMO in .net

Can't script remote database using script method


Get Detach or Attach all user databases script

Script to generate script to detach or attach user databases