Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Roles and User Permissions Script for SQLSERVER 2000


Roles and User Permissions Script for SQLSERVER 2000

Author
Message
guessme
guessme
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 52
hi anyone please post query for all sql permissions and role permissions of all users in a database for SQLSERVER 2000.
I did lot of research in the internet but i didn't find any script to resolve my issue...!

i badly required it asap.
Please ........!
Daxesh Patel
Daxesh Patel
SSC-Enthusiastic
SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)SSC-Enthusiastic (122 reputation)

Group: General Forum Members
Points: 122 Visits: 1047
In following query if a.Islogin=0 then consider a.name as database Role else database user

select a.name UserName,a.Islogin, c.name ObjectName,
   case b.actadd
   when 1 then 'SELECT'
   when 2 then 'UPDATE'
   when 3 then 'SELECT,UPDATE'
   when 4 then 'REFERENCES'
   when 5 then 'SELECT, REFERENCES'
   when 6 then 'UPDATE,REFERENCES'
   when 7 then 'SELECT,UPDATE,REFERENCES'
   when 8 then 'INSERT'
   when 9 then 'SELECT,INSERT'
   when 10 then 'UPDATE,INSERT'
   when 11 then 'SELECT,UPDATE,INSERT'
   when 12 then 'REFERENCES,INSERT'
   when 13 then 'SELECT,REFERENCES,INSERT'
   when 14 then 'UPDATE,REFERENCES,INSERT'
   when 15 then 'SELECT,UPDATE,REFERENCES,INSERT'
   when 16 then 'DELETE'
   when 17 then 'SELECT,DELETE'
   when 18 then 'UPDATE,DELETE'
   when 19 then 'SELECT,UPDATE,DELETE'
   when 20 then 'REFERENCES,DELETE'
   when 21 then 'SELECT,REFERENCES,DELETE'
   when 22 then 'UPDATE,REFERENCES,DELETE'
   when 23 then 'SELECT,UPDATE,REFERENCES,DELETE'
   when 24 then 'INSERT,DELETE'
   when 25 then 'SELECT,INSERT,DELETE'
   when 26 then 'UPDATE,INSERT,DELETE'
   when 27 then 'SELECT,UPDATE,INSERT,DELETE'
   when 28 then 'REFERENCES,INSERT,DELETE'
   when 29 then 'SELECT,REFERENCES,INSERT,DELETE'
   when 30 then 'REFERENCES,INSERT,DELETE'
   when 31 then 'SELECT,UPDATE,REFERENCES,INSERT,DELETE'
   when 32 then 'EXECUTE' else NULL end GRANTED,
   case b.actmod
   when 1 then 'SELECT'
   when 2 then 'UPDATE'
   when 3 then 'SELECT,UPDATE'
   when 4 then 'REFERENCES'
   when 5 then 'SELECT, REFERENCES'
   when 6 then 'UPDATE,REFERENCES'
   when 7 then 'SELECT,UPDATE,REFERENCES'
   when 8 then 'INSERT'
   when 9 then 'SELECT,INSERT'
   when 10 then 'UPDATE,INSERT'
   when 11 then 'SELECT,UPDATE,INSERT'
   when 12 then 'REFERENCES,INSERT'
   when 13 then 'SELECT,REFERENCES,INSERT'
   when 14 then 'UPDATE,REFERENCES,INSERT'
   when 15 then 'SELECT,UPDATE,REFERENCES,INSERT'
   when 16 then 'DELETE'
   when 17 then 'SELECT,DELETE'
   when 18 then 'UPDATE,DELETE'
   when 19 then 'SELECT,UPDATE,DELETE'
   when 20 then 'REFERENCES,DELETE'
   when 21 then 'SELECT,REFERENCES,DELETE'
   when 22 then 'UPDATE,REFERENCES,DELETE'
   when 23 then 'SELECT,UPDATE,REFERENCES,DELETE'
   when 24 then 'INSERT,DELETE'
   when 25 then 'SELECT,INSERT,DELETE'
   when 26 then 'UPDATE,INSERT,DELETE'
   when 27 then 'SELECT,UPDATE,INSERT,DELETE'
   when 28 then 'REFERENCES,INSERT,DELETE'
   when 29 then 'SELECT,REFERENCES,INSERT,DELETE'
   when 30 then 'REFERENCES,INSERT,DELETE'
   when 31 then 'SELECT,UPDATE,REFERENCES,INSERT,DELETE'
   when 32 then 'EXECUTE' else NULL end DENIED
   from dbo.sysusers a,
   dbo.syspermissions b,
   dbo.sysobjects c
   where a.uid = b.grantee and b.[id] = c.[id] and b.grantee <> 0
   order by a.name


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search