October 3, 2009 at 1:25 am
Dear All,
How to provide exec rights to a specific user on all User & System functions?
Regards,
Sarabpreet Singh 😎
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
October 3, 2009 at 5:36 pm
You should always try to grant permissions to a role you've created and then put the appropriate users in that role. If you also want the role to have execute rights on all stored procedures as well, you can simply:
GRANT EXECUTE ON SCHEMA::dbo
Assuming all are in the dbo schema. If you only want functions, the best thing to do is use a query to build the permissions T-SQL for you:
SELECT 'GRANT EXECUTE ON [' + SCHEMA_NAME(schema_id) + '].[' + [name] + '] TO MyRole;'
FROM sys.objects
WHERE type = 'FN';
Then take the code you've generated and execute it.
K. Brian Kelley
@kbriankelley
October 4, 2009 at 11:32 pm
K. Brian Kelley (10/3/2009)
You should always try to grant permissions to a role you've created and then put the appropriate users in that role. If you also want the role to have execute rights on all stored procedures as well, you can simply:
I know its a best practice, thanks. i'll do the same from now onwards.
and thanks for the help Sir [:)]
Regards,
Sarabpreet Singh 😎
Sarabpreet.com
SQLChamp.com
Twitter: @Sarab_SQLGeek
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply