Bee Pee

UPDATE failed because the following SET options have incorrect settings: ‘ARITHABORT

Today i tried to create a filtered index , i was able to create them alright. However, intrestingly when i tried to update record i got the following error
“UPDATE failed because the following SET options have incorrect settings: ‘ARITHABORT’. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations”

and when i tried to create new record the same

“INSERT failed because the following SET options have incorrect settings: ‘ARITHABORT’. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations”

Why does this occur in first place. This is because by default ARITHABORT is set to OFF. So what does it mean when ARITHABORT is set to OFF. Quoting MSDN http://msdn.microsoft.com/en-us/library/ms190249(v=sql.105).aspx
“When ON is specified, a query is ended when an overflow or divide-by-zero error occurs during query execution.
When OFF is specified, a warning message is displayed when one of these errors occurs, but the query, batch, or transaction continues to process as if no error occurred.” So basically we need o have the option on anyways. If we have it ON instead of the default OFF we will get the error instead of sweeping it off under the carpet. This may not be ideal for every one but it was for us in this case.

But what if you dont control the SQL Server settings and your DBA does not allow you to change the setting what then. Here is the link http://www.codeproject.com/Articles/55471/Working-Around-Issues-When-Using-SQL-Server-Indexe which could help to set the settings at the connection level.

Hope this helps any one who stumbles across this page.

Leave a Reply

Your email address will not be published. Required fields are marked *