February 6, 2006 at 4:17 pm
Is there a way to check the list of users who have execute permissions on a stored procedure ?
Thanks,
February 6, 2006 at 8:53 pm
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'
February 7, 2006 at 12:01 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply