I was trying to get a Matrix working on SQL Reporting Services when I ran across this error:
Cannot find the object ‘dbo.HooperSnooper’ because it does not exist or you do have permissions
Well, it did exist and I did have permissions to it. At least, I thought I did.
The “solution” was to drop the procedure, recreate it, and grant the db_executor account permissions to the stored procedure:
GRANT EXECUTE ON [dbo].[HooperSnooper] TO db_executor GO
The first time I tried, it didn’t work. That was because I forgot to put the GO command after I created the SP. The correct syntax is (drum roll)…
CREATE PROCEDURE [dbo].[HooperSnooper] @Hooper int, @Snooper int AS BEGIN SELECT * FROM HooperSnooper WHERE Hooper = @Hooper AND Snooper = @Snooper END GO GRANT EXECUTE ON [dbo].[HooperSnooper] TO db_executor GO
I must have missed a GO statement somewhere along the line. Those GOs are important, or so I’ve heard.