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

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.

EDIT:

Per the answer by @Leonidius and related comments, the SQLCMD command-line utility defaults to QUOTED_IDENTIFIER OFF for backwards compatibility. This behavior differs from SSMS and is a common gotcha when deployment scripts don’t explicitly include QUOTED_IDENTIFIER ON statements before creating stored procedures and other objects.

I strongly suggest one make a habit of specifying the -I SQLCMD argument to ensure QUOTED_IDENTIFIER OFF is not set inadvertently.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)