Solved

DELETE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER, ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on

Posted on 2014-02-03
5
6,186 Views
Last Modified: 2014-04-11
Dear all,
when I try to execute  a SP I got this error
DELETE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER, 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.
I set :
SET ANSI_NULLS ON
SET ANSI_PADDING OFF
SET ANSI_WARNINGS OFF
SET ARITHABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER OFF

any ideas?
0
Comment
Question by:ethar1
  • 3
5 Comments
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39831058
Apparently the target table is part of indexed view. When you work with
an indexed view, the following SET options must be on: ANSI_PADDING,
ANSI_NULLS, QUOTED_IDENTIFIER, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL
and ARITHABORT.
Of these the last three depend on run-time values only.
ANSI_PADDNING also depends on how the setting when the columns were
created. And for ANSI_NULLS and QUOTED_IDENTIFIER the setting is saved
when you create with the stored procedure/trigger.

So please drop the stored procedure, set the options to ON and create the stored procedure in the same query management window and give it a try
0
 

Author Comment

by:ethar1
ID: 39831599
I drop the SP , and set the options , then recreate the SP , but same result.
also I save those options  saved on the SP.

How can list all indexed views?
0
 

Author Comment

by:ethar1
ID: 39873972
any update?
0
 

Author Comment

by:ethar1
ID: 39987960
I got the error only when run it from MS Agent, but when I run the SP from Microsoft SQL Server Management Studio       its work fine

Executed as user: NT AUTHORITY\SYSTEM. DELETE 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. [SQLSTATE 42000] (Error 1934).  The step failed.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 39990378
When you use SQL Server Agent you have to do a SET ARITHABORT ON and SET QUOTED_IDENTIFIER ON in the job step, as in:

SET ARITHABORT ON
SET QUOTED_IDENTIFIER ON
EXEC usp_YourStoredProcedureGoesHere
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question