locked
execute permissions RRS feed

  • Question

  • Hi Team,

    one of the user is asking to give execute permission on Perticular table

    I think 1st i have to create role

    for that role i have to give execute permission

    GRANT EXECUTE ON OBJECT::HumanResources.uspUpdateEmployeeHireInfo
        TO Recruiting11;
    GO

    How can we create role how can we give excute on this please guide me.

    CREATE ROLE buyers execute enMiller;

    Tx


    subu


    • Edited by subu999 Thursday, February 23, 2012 4:52 PM
    Thursday, February 23, 2012 4:50 PM

Answers

  • Subu: You can not grant/give the execute permissions on table. For reference please find below snapshot. the permissions you can grant on the table what you are seeing in the image only...

    Please check with the requestor, what he is looking exatly... :)


    Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)

    • Marked as answer by Maggie Luo Friday, March 2, 2012 7:50 AM
    Tuesday, February 28, 2012 1:51 PM

All replies

  • As per http://msdn.microsoft.com/en-us/library/ms187965.aspx you can not grant execute to a table. Extract below:

    'If the securable is a database, ALL means BACKUP DATABASE, BACKUP LOG, CREATE DATABASE, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, and CREATE VIEW. 

  • If the securable is a scalar function, ALL means EXECUTE and REFERENCES.

  • If the securable is a table-valued function, ALL means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.

  • If the securable is a stored procedure, ALL means EXECUTE.

  • If the securable is a table, ALL means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.

  • If the securable is a view, ALL means DELETE, INSERT, REFERENCES, SELECT, and UPDATE.'

  • I suspect you would like to grant execute on the procedure HumanResources.uspUpdateEmployeeHireInfo

  • An example of granting execute on a procedure via a database role would be:

  • USE mydatabase
    GO
    CREATE ROLE buyers
    GO
    EXEC sp_addrolemember N'buyers', N'Recruiting11'
    GO
    GRANT EXECUTE ON HumanResources.uspUpdateEmployeeHireInfo TO buyers
    GO

Thursday, February 23, 2012 8:40 PM
  • Subu: You can not grant/give the execute permissions on table. For reference please find below snapshot. the permissions you can grant on the table what you are seeing in the image only...

    Please check with the requestor, what he is looking exatly... :)


    Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)

    • Marked as answer by Maggie Luo Friday, March 2, 2012 7:50 AM
    Tuesday, February 28, 2012 1:51 PM