Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

show which groups have permissions on which stored procedures

Status
Not open for further replies.
Jun 28, 2001
30
US
What's the best way to get a list of which user groups have permission to execute which stored procs?

Thanks.
 
Try using (wihtin a given database):

exec sp_helprotect

This returns grantee names and action types.

Hope this helps.


carrr
 
Sometimes, I prefer to create my own procedure to get info such as this because the built in system SPs provide too much info. The following script returns all SP execute permissions for a database.

--Initialize
set nocount on
set ansi_warnings off

--Create temp table for intermediate results
Create Table #protects
(Owner varchar(12), Object varchar(60),
Grantee varchar(20), Grantor varchar(12),
Type varchar(12),
[Action] varchar(12), [Column] varchar(30))

--Insert the output of sp_helprotect into temp table
Insert #protects
(Owner, Object, Grantee,
Grantor, Type,
[Action], [Column])
exec travel.dbo.sp_helprotect

--Select columns I want to see
--from rows with 'execute' permission
Select Owner, Object, Grantee, Type, [Action]
From #protects
Where [Action]='Execute'
Order By Object, Grantee, Type

--clean up
drop table #protects
set ansi_warnings on
Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top