Execute stored proc fails with GRANT EXECUTE becau

2019-08-12 21:41发布

问题:

I have created a stored proc on schema X that does a select across 10+ tables that are in schema X and Y.

I created a database role DBRole and added a new AD Group Login to it.

I thought all I needed to do was grant execute on x.MyStoredProc to DBRole, but I'm getting errors because of select permission..

Stored Procedure MYSCHEMA.MyStoredProc failed: The SELECT permission was denied on the object 'myTable', database 'Db', schema 'dbo'.

I wondered if it was because the tables its failing on are in a different schema but, doing a quick test that still worked..

Can anyone explain what I'm missing?