If you’re getting an error that reads something like “Incorrect syntax near the keyword ‘OR’” when creating a filtered index in SQL Server, it’s probably because you’re using the OR
operator in your WHERE
clause.
Filtered indexes don’t support the OR
operator.
However, filtered indexes do support the IN
operator, and so it’s possible to change your query to use that.
So to fix this issue, try the IN
operator instead.