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\'
Possible typo or already removed? Refresh your view or query for it (looks like this was for a stored procedure):
SELECT name AS procedure_name
,SCHEMA_NAME(schema_id) AS schema_name
,type_desc
,create_date
,modify_date
FROM sys.procedures;
Then if it's listed, copy the name and try your query with the name taken from those results (or copy the object's name any other way you may be familiar with).
MORE GENERIC SOLUTION FOR ANY OBJECT (if you have SSMS): In SQL Server Management Studio, right-click on the object, "Script [OBJECT_TYPE] as", DROP To (or the action you're attempting), New Query Editor.
If you can run this successfully you probably had a typo.