Msg 1088, Level 16, State 12, Line 2
Cannot find the object “%.*ls” because it does not exist or you do not have permissions.
This error message appears when you try to reference a database object that either does not exist, or to which you don’t have access permission.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. The database object, that you are referencing must both exist, and you must have appropriate permissions to access it.
All versions of SQL Server.
SET NUMERIC_ROUNDABORT OFF;
IF OBJECT_ID (‘dbo.MyOrderView’, ‘View’) > 0
DROP VIEW dbo.MyOrderView;
CREATE VIEW dbo.MyOrderView
SELECT SUM(UnitPrice*Quantity*(1.00-Discount)) AS Revenue,
OrderDate, ProductID, COUNT_BIG(*)
FROM dbo.[Order Details] AS od
JOIN dbo.Orders AS o
ON od.OrderID = o.OrderID
GROUP BY OrderDate, ProductID;
CREATE UNIQUE CLUSTERED INDEX cix_MyOrderView
ON dbo.MyOrderView (OrderDate, ProductID);
In the above example we try to create an indexed view. Because this statement cannot be completed successfully, the object MyOrderView does not exist at the point when the CREATE INDEX statement is fired. This raises the error.