SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Check execute permissions on stored procedure ?


Check execute permissions on stored procedure ?

Author
Message
Farah Saleem
Farah Saleem
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 1

Is there a way to check the list of users who have execute permissions on a stored procedure ?

Thanks,


Ken Johnson-162971
Ken Johnson-162971
SSC Veteran
SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)SSC Veteran (234 reputation)

Group: General Forum Members
Points: 234 Visits: 375
Hi Farha Saleem,

You can open the properties dialog in Enterprise Manager and click "Permissions..."

or, you can do it with a query (you'll have to add the schema portion if you need that)...
SELECT su.name, -- user name with permission
so.name -- procedure name
FROM syspermissions AS sp
INNER JOIN sysobjects AS so
ON sp.id = so.id
INNER JOIN sysusers AS su
ON sp.grantee = su.uid
WHERE so.name = 'procedure_name'
Strommy
Strommy
Old Hand
Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)Old Hand (384 reputation)

Group: General Forum Members
Points: 384 Visits: 351

Hi. Your best bet is to use the "sp_helpprotect" system stored procedure. Here is the syntax (from Books Online):

sp_helprotect [ [ @name = ] 'object_statement' ]
[ , [ @username = ] 'security_account' ]
[ , [ @grantorname = ] 'grantor' ]
[ , [ @permissionarea = ] 'type' ]

In your case, you would use:

"sp_protect 'stored_procedure_name'"

For these types of questions, books online is by far the best resource there is. In fact, if you click the index tab and type in sp_helpprotect, it will go into a lot more detail about its use and what not. I hope this helps.

Thanks,

Eric





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