Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > SQL for User and Group Permission Report

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-04, 20:32
maredman maredman is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
SQL for User and Group Permission Report

Due to the new Sarbanes-Oxley control requirements, I need to produce a report showing all users in a database, what group they are in and what permissions are assigned to the group. Can someone help me out with the SQL to produce this output?
I will be eternally grateful for any help you can provide.

Thanks!
MArk A. Redman
The Southern Company
Reply With Quote
  #2 (permalink)  
Old 06-21-04, 05:10
perl perl is offline
Registered User
 
Join Date: Jun 2003
Posts: 140
Use sp_helpuser to get list of all the users and the group they belong to
Use sp_helprotect "group name" to get all the database permission of that group

Alternatively you can insert all the result of sp_helpuser to a temptable
and sort it by group name then execute sp_helprotect for each group
one by one

hope this helps u,
all the best !
Reply With Quote
  #3 (permalink)  
Old 06-21-04, 15:43
maredman maredman is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
RE: How

Thanks! That is great information. How can I insert the results of the sp_heluser command into a table?
I realize that this is probably a very simple question but I cannot remember ever having tried this before.

Thanks again,
Mark.
Reply With Quote
  #4 (permalink)  
Old 06-22-04, 03:25
perl perl is offline
Registered User
 
Join Date: Jun 2003
Posts: 140
good question, but reply is simple , if you look at sp_helpuser proc
data goes to #tmp table in all cases, all you have to do is to create dummy proc with the same contents of sp_helpuser , something like

sp_helpuser_byme and replace #tmp table with permanent table inside
and then in last line of your proc simply select all the rows from that table !!
This will be your user and group report then you can take each group from
this table and run sp_helprotect aginst that
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On