At the Application_Start of my web site I execute a stored procedure to read some data from one SQL Server 2008 database.
This is the only call to this database.
I would create a specific SQL Server user, with read-only permission, to exec this sp.
I created a new SQL Server user with db_datareader role, but when I exec the sp I have an error at this line:
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
The error is: EXECUTE permission denied on object ...
How can I workaround this ?
Thanks
db_datareaderrole, and granted him the permission to execute the SP. Have you considered granting him the right to connect to your DB? As odd as it sounds, connection permissions are required for a user to connect and do whatever against a database.