Set Quoted_Identifier ON;

Hi experts,
I have a job which deletes from many tables. Each job step deletes from 1 tables. A few steps are failing with this error. I remedied it by using SET QUITED_IDENTIFIER ON, before the delete statement.
Some of these tables have indexed views, those seem to be the ones that require SET QUITED_IDENTIFIER ON,

My question is this: Would it be bad practice to just SET QUITED_IDENTIFIER ON on each and every job step?

Thanks

DELETE 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. [SQLSTATE 42000] (Error 1934). The step failed.

No; in fact, it's best practice to SET ANSI_NULLS ON; and SET QUOTED_IDENTIFIER ON; for any and all SQL that has DDL (any object create / alter).

1 Like

Thanks @ScottPletcher That's much easier than having to work thru the failures one a t a time.