Correct ARITHABORT settings to address SQL Error 1934

Problem:
I was trying to add new users to the database using a SQL job which use to fail with Error 1934, but when I run the same command on SQL Query Window there was no error. Following is the error message for reference:
Error: CONDITIONAL 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 query notifications and/or xml data
type methods. (Microsoft SQL Server, Error: 1934)

Cause of the Error: This use to occur as ARITHABORT setting was OFF on specific session. I had to manually enable ARITHABORT to avoid the error.


---- How to Check ARITHABORT property on this session
select sessionproperty('ARITHABORT') -- 1 indicates enable, 0 indicates disable
select @@OPTIONS&64

---- How to Change the settings
set ARITHABORT ON -- To Enable
set ARITHABORT OFF -- To Disable

Reference:
For using Options in SQL Server: http://msdn.microsoft.com/en-us/library/ms191203.aspx .
Different Options and Description: http://www.mssqltips.com/sqlservertip/1415/determining-set-options-for-a-current-session-in-sql-server/

Shortlink: http://wp.me/p4hkoz-r

Advertisements
This entry was posted in SQL, SQL Error, Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s