You cannot use query hints (OPTIONs) in a view.
A view is just a macro that expands. Then the query hint will be internal in the extension because the view is a subquery. Query hints are not allowed in subqueries.
Effectively, you will have the following:
select
*
from
(
SELECT
order_date, DATEPART(W, order_date) AS dayID, Type
FROM dbo.Shipment_Dates
WHERE (TIP = 'normal')
option (fast 20)
) WasAView
From MSDN :
Query hints can only be specified in a top-level query, not in subqueries.
source
share