Monday, February 13, 2012

ARITHABORT and Indexed Views

I've just implemented indexed views to increase the performance of one of my
stored procedures. However,
it turns out that you cannot insert into a table that is referenced by an
index view unless the ARITHABORT is set to ON.
You cannot set it to ON inside the procedure. (see
http://support.microsoft.com/default.aspx?kbid=305333).
The recommendation from Microsoft is to turn this on from the
application. -- Unfortunately, I don't have control over that. I did find a
solution: "ALTER DATABASE nwind SET ARITHABORT ON".
I'm a little hesitant to use this in production, as many apps use this
particular database. Does anybody know of any potential gotchas? It seems
to me that if my apps were generating divide-by-zero or overflow errors,
they wouldn't be working anyway.The chances of this causing a problem are pretty slim but you should try it
on a backup copy of the database to make sure there aren't some unforeseen
issues.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"MAS" <mark_stricker@.hotmail.com> wrote in message
news:eKGlalNLGHA.2392@.TK2MSFTNGP09.phx.gbl...
> I've just implemented indexed views to increase the performance of one of
> my stored procedures. However,
> it turns out that you cannot insert into a table that is referenced by an
> index view unless the ARITHABORT is set to ON.
> You cannot set it to ON inside the procedure. (see
> http://support.microsoft.com/default.aspx?kbid=305333).
> The recommendation from Microsoft is to turn this on from the
> application. -- Unfortunately, I don't have control over that. I did find
> a solution: "ALTER DATABASE nwind SET ARITHABORT ON".
> I'm a little hesitant to use this in production, as many apps use this
> particular database. Does anybody know of any potential gotchas? It
> seems to me that if my apps were generating divide-by-zero or overflow
> errors, they wouldn't be working anyway.
>
>

No comments:

Post a Comment