Skip to content
Microsoft SQL Server

SQL Server Error 1934

Statement failed because SET options have incorrect settings

Applies to: All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
Last technically reviewed 23 October 2026 on SQL Server 2025 (17.0.1145.4)
The full message
Msg 1934, Level 16, State 1, Line 1
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.
Other forms of this message
Creating a filtered index with the wrong setting
Msg 1934, Level 16, State 1, Line 1
CREATE INDEX 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.
Reading an indexed view WITH (NOEXPAND)
Msg 1934, Level 16, State 1, Line 1
SELECT failed because the following SET options have incorrect settings: 'ANSI_WARNINGS'. 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.
An indexed computed column
Msg 1934, Level 16, State 1, Line 1
INSERT failed because the following SET options have incorrect settings: 'CONCAT_NULL_YIELDS_NULL'. 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.
Error number
1934
Severity
16 (user-correctable error)
State
1
Product
Microsoft SQL Server Database Engine
Versions
All supported SQL Server versions (2016 to 2025), Azure SQL Database, Azure SQL Managed Instance
Last reviewed
23 October 2026

What it means

Error 1934 means the statement touches a filtered index, an indexed view, an index on a computed column or a similar feature, and the session (or the procedure) is running with a SET option such as QUOTED_IDENTIFIER or ANSI_NULLS in the wrong position.

Filtered indexes, indexed views and indexes on computed columns store precomputed results. Those results are only correct if every session evaluates expressions the same way, so SQL Server requires a fixed set of options whenever such an index is created or modified: ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL and QUOTED_IDENTIFIER ON, and NUMERIC_ROUNDABORT OFF (with ANSI_WARNINGS ON, ARITHABORT is treated as ON). If one is wrong, the INSERT, UPDATE, DELETE, MERGE or CREATE INDEX fails with 1934 at severity 16.

Read the message in two parts: the first word is the statement that failed, and the name in quotes is the option that is set wrongly. The long list at the end is generic and does not tell you which feature is involved. Two settings behave specially: QUOTED_IDENTIFIER and ANSI_NULLS are saved with a stored procedure, trigger or function when it is created, so a module created with them OFF fails even when the caller has them ON.

Common causes

  • A client or tool that connects with QUOTED_IDENTIFIER OFF. The sqlcmd utility does this unless it is run with -I; older drivers and some scripts set it explicitly.
  • A stored procedure or trigger that was created while QUOTED_IDENTIFIER or ANSI_NULLS was OFF, so it keeps that setting every time it runs.
  • A script that sets ANSI_NULLS OFF, ANSI_WARNINGS OFF or CONCAT_NULL_YIELDS_NULL OFF for legacy behaviour and then writes to a table with one of these indexes.
  • A new filtered index or indexed view added to an existing table, which makes old code with non-standard settings start failing on its next write.

Diagnose it

Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.

Check the SET options of your session

SELECT quoted_identifier, ansi_nulls, ansi_padding, ansi_warnings,
       arithabort, concat_null_yields_null
FROM sys.dm_exec_sessions
WHERE session_id = @@SPID;
What to look for

A 0 in the column named in the message is the cause, if the statement was run directly rather than from a procedure. arithabort = 0 on its own is normal for many drivers and sqlcmd: while ansi_warnings is 1 it does not raise 1934.

Find modules saved with QUOTED_IDENTIFIER or ANSI_NULLS OFF

SELECT OBJECT_SCHEMA_NAME(m.object_id) + '.' + OBJECT_NAME(m.object_id) AS module_name,
       o.type_desc, m.uses_quoted_identifier, m.uses_ansi_nulls
FROM sys.sql_modules AS m
JOIN sys.objects AS o ON o.object_id = m.object_id
WHERE m.uses_quoted_identifier = 0 OR m.uses_ansi_nulls = 0
ORDER BY module_name;
What to look for

Procedures, triggers and functions that will raise 1934 when they write to a table with a filtered index or indexed view, whatever the caller's settings are.

Which indexes on the table need the settings?

SELECT OBJECT_NAME(i.object_id) AS table_or_view, i.name AS index_name,
       i.has_filter, i.filter_definition, o.type_desc
FROM sys.indexes AS i
JOIN sys.objects AS o ON o.object_id = i.object_id
WHERE i.has_filter = 1 OR o.type = 'V'
UNION ALL
SELECT OBJECT_NAME(ic.object_id), i.name, i.has_filter, cc.name + ' (computed column)', 'USER_TABLE'
FROM sys.index_columns AS ic
JOIN sys.indexes AS i ON i.object_id = ic.object_id AND i.index_id = ic.index_id
JOIN sys.computed_columns AS cc ON cc.object_id = ic.object_id AND cc.column_id = ic.column_id;
What to look for

Filtered indexes, indexed views and indexes on computed columns. Any write that touches these needs the standard settings.

Which applications connect with non-standard settings?

SELECT session_id, login_name, host_name, program_name,
       quoted_identifier, ansi_nulls, ansi_warnings, concat_null_yields_null
FROM sys.dm_exec_sessions
WHERE is_user_process = 1
  AND (quoted_identifier = 0 OR ansi_nulls = 0 OR ansi_warnings = 0 OR concat_null_yields_null = 0);
What to look for

The program names show which tools or applications need their connection settings corrected.

How to fix it

Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.

Set the standard options in the session or script

Client or network side

Put the standard settings at the top of the script or connection, or remove the line that turns one OFF. With sqlcmd, add -I so QUOTED_IDENTIFIER is ON.

SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;

-- command line: sqlcmd -S MyServer -d AppDb -E -I -i load.sql

Recreate the procedure or trigger with the right settings

Changes schema

A module keeps the QUOTED_IDENTIFIER and ANSI_NULLS values that were in force when it was created. Run CREATE OR ALTER again in a batch that has both ON; the body does not need to change. Script the current definition first so you recreate it exactly.

SET QUOTED_IDENTIFIER ON;
SET ANSI_NULLS ON;
GO
CREATE OR ALTER PROCEDURE dbo.AddTicket @id INT
AS
BEGIN
    INSERT INTO dbo.Tickets (id, status) VALUES (@id, 'open');
END;
GO

Fix the client connection settings

Client or network side

Modern drivers (ODBC, OLE DB, .NET SqlClient, JDBC) connect with the standard settings. If an application turns options OFF, change its connection or session start-up code rather than removing the index. The diagnostic above shows which program name to look for.

Examples

A filtered index and QUOTED_IDENTIFIER OFF

CREATE TABLE dbo.Tickets (id INT PRIMARY KEY, status VARCHAR(20));
GO
CREATE INDEX IX_Tickets_Open ON dbo.Tickets (id) WHERE status = 'open';
GO
SET QUOTED_IDENTIFIER OFF;
INSERT INTO dbo.Tickets (id, status) VALUES (1, 'open');
Result
Msg 1934, Level 16, State 1, Line 2
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.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

A procedure created with QUOTED_IDENTIFIER OFF fails even when the caller has it ON

CREATE TABLE dbo.Tickets (id INT PRIMARY KEY, status VARCHAR(20));
GO
CREATE INDEX IX_Tickets_Open ON dbo.Tickets (id) WHERE status = 'open';
GO
SET QUOTED_IDENTIFIER OFF;
GO
CREATE PROCEDURE dbo.AddTicket @id INT
AS
BEGIN
    INSERT INTO dbo.Tickets (id, status) VALUES (@id, 'open');
END;
GO
SET QUOTED_IDENTIFIER ON;   -- the caller is fine...
GO
EXEC dbo.AddTicket 1;       -- ...but the procedure saved OFF
Result
Msg 1934, Level 16, State 1, Procedure dbo.AddTicket, Line 4
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.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

An indexed view and ANSI_NULLS OFF

CREATE TABLE dbo.Sales (id INT PRIMARY KEY, region VARCHAR(20) NOT NULL, amount DECIMAL(10,2) NOT NULL);
GO
CREATE VIEW dbo.vSalesByRegion WITH SCHEMABINDING AS
SELECT region, SUM(amount) AS total, COUNT_BIG(*) AS row_count
FROM dbo.Sales
GROUP BY region;
GO
CREATE UNIQUE CLUSTERED INDEX CIX_vSalesByRegion ON dbo.vSalesByRegion (region);
GO
SET ANSI_NULLS OFF;
INSERT INTO dbo.Sales VALUES (1, 'North', 10);
Result
Msg 1934, Level 16, State 1, Line 2
INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS'. 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.

Reproduced on SQL Server 2025 (17.0.1145.4), 23 October 2026.

How to prevent it

Never change the standard SET options in application code or deployment scripts. Run sqlcmd with -I, and make your deployment pipeline create every module with QUOTED_IDENTIFIER and ANSI_NULLS ON. A periodic run of the sys.sql_modules query above catches modules that slipped through.

Before adding a filtered index, an indexed view or an index on a computed column, check which procedures and jobs write to the table, because they all start to depend on the standard settings. For background on filtered and other index types, see SQL indexes.

Common questions

Why does my procedure fail with 1934 when SSMS has QUOTED_IDENTIFIER ON?

Stored procedures, triggers and functions keep the QUOTED_IDENTIFIER and ANSI_NULLS settings from the moment they were created. Recreate the module with both ON; the caller's settings do not override them.

Should I drop the filtered index to make the error go away?

No. The index is not the problem; the session or module settings are. Dropping it can hurt performance and hides code that also behaves differently with NULLs and quoted names.

Does a plain SELECT raise error 1934?

Usually not: reads simply skip a filtered index or indexed view the Query Optimizer cannot use with the current settings. A SELECT that forces an indexed view with the NOEXPAND hint does raise it, as do inserts, updates, deletes and CREATE INDEX.

Learn more on CodeWithSQL

Official documentation

Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.

Still stuck on a SQL Server error?

Browse the full SQL Server error library, or get hands-on help from an experienced SQL professional.