CREATE VIEW xxxx AS
SELECT order_date,
DATEPART(W, order_date) AS dayID,
Type
FROM dbo.Shipment_Dates
WHERE (TIP = 'normal')
OPTION (FAST 20)
This create statment causes error at hint part .. Is there a workaround for adding hint to views?
You can’t use query (OPTION) hints in a view.
A view is simply a macro that expands. The query hint would then be internal in the expansion because the view is then a subquery. And query hints are not allowed in subqueries.
Effectively, you’d have this:
From MSDN: