Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'

Tags:

sql-server

We are getting the below message sometimes while executing the stored procedure, after that without any change deleting and re-executing the stored procedure it is working fine.

DBCORE INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. 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.

Kindly help us to understand this.

like image 568
Pratheeskumar Avatar asked Nov 08 '16 12:11

Pratheeskumar


People also ask

What is set Quoted_identifier on in SQL Server?

SET QUOTED_IDENTIFIER must be ON when you are creating or changing indexes on computed columns or indexed views. If SET QUOTED_IDENTIFIER is OFF, then CREATE, UPDATE, INSERT, and DELETE statements will fail on tables with indexes on computed columns, or tables with indexed views.

What is Quoted_identifier?

This setting is used to determine how quotation marks will be handled. When QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks and literals must be delimited by single quotation marks.


1 Answers

QUOTED_IDENTIFIER is a "sticky" option so the setting in effect when the procedure was created is used at runtime. Since no procedure changes were made, the error suggests the stored procedure was created with QUOTED_IDENTIFIER OFF and an index with one of the types mentioned in the error message was created/dropped.

Recreate or alter the stored procedure from a session with both QUOTED_IDENTIFIER ON and ANSI_NULLS ON to avoid the problem going forward.

like image 96
Dan Guzman Avatar answered Oct 10 '22 19:10

Dan Guzman