I\'m getting the following error when calling a stored procedure:
Cannot find the object \"XXX\" because it does not exist or you do not have permission.
I\'
Ok, here's what happened. There was a special character before the end of the SP so it was incomplete yet still valid, somehow.
So I could see the SP and see the permissions on it but I could not run it. So to solve the issue I had to copy the text out of SQL Management Studio and paste it into Notepad, then remove the special character, then copy and paste it back into SQL Management Studio and run the alter script.
Very strange how the character got there!