What Tibor correctly suggests is documented in BOL under the "Duration of
SET Options" section of
Keep in mind that the indexed view itself must *already* have been created
using those settings (from
When **creating** indexed views or manipulating rows in tables
participating in an indexed view, seven SET options must be assigned
specific values. The SET options ARITHABORT, CONCAT_NULL_YIELDS_NULL,
QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_PADDING, and ANSI_WARNING must be ON.
The SET option NUMERIC_ROUNDABORT must be OFF.
(** is my emphasis).
Finally, from the same URL:
In addition, for a SELECT statement that involves an indexed view, if the
values of any of the SET options are not the required values, SQL Server
processes the SELECT without considering the indexed view substitution.
is what I suspect you wish that code to accommodate. You can verify whether
that is accomodated (whether an indexed view is being used) via the use of
Microsoft, SQL Server
This posting is provided "AS IS" with no warranties, and confers no
rights. Subscribe to MSDN & use http://msdn.microsoft.com/newsgroups.