Execute permission on a function

  • Hi All,

    I am relatively new to SQL and I have been given read only access to a database. I know that there is a stored procedure in that database to create a table. I have got the query for the stored procedure, but obviously if I try to execute that query, I get an error because I am not allowed to write tables in the database. So, I have modified the query by creating a temporary table, which seems to have solved the problem.

    But I get another error:

    The EXECUTE permission was denied on the object 'extract_int_from_string', database 'MP_STATIC', schema 'dbo'.

    I can't even see that function in the list, I don't know why. I think that it is a function which gets the integer number form a string, because if I replace that function with a number, I don't get that error. I guess I need someone to give me execute permission on that function?

    Many thanks

  • You need to contact the people in charge of providing the necessary permissions.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • evaz wrote:

    I guess I need someone to give me execute permission on that function?

    Yes, that's what you need to ask for.

  • You need EXECUTE permission to execute procedures or functions. If this is in the same database, it's just

    GRANT EXECUTE ON dbo.MP_STATIC TO <your user>

    If it's in another database, you need rights to connect to that database.

  • Thank you all!

    I have asked and they are sorting it out 🙂

  • evaz wrote:

    Thank you all!

    I have asked and they are sorting it out 🙂

     

    Excellent!  I have found that "The answer is always 'NO'... unless you ask". 😀

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply