Sql-server – The EXECUTE permission was denied on the object ‘xxxxxxx’, database ‘zzzzzzz’, schema ‘dbo’

sql server

I'm having problems executing a function.

Here's what I did:

  1. Create a function using SQL Server Management Studio. It was successfully created.
  2. I then tried executing the newly created function and here's what I get:

The EXECUTE permission was denied on
the object 'xxxxxxx', database
'zzzzzzz', schema 'dbo'.

Best Answer

Sounds like you need to grant the execute permission to the user (or a group that they a part of) for the stored procedure in question.

For example, you could grant access thus:

USE zzzzzzz;
GRANT EXEC ON dbo.xxxxxxx TO PUBLIC