Why use quoted_identifier to use a filtered index?

There are many questions here on SO and articles online on how to deal with this mess, but my question is more fundamental: WHY? The quoted identifier appears to be a property of how the engine interprets requests and has nothing to do with the data inside. Regarding index queries and insert / update queries, who needs it? Why does this parameter matter?

Suppose you allowed inserts / updates to succeed if quoted_identifier is set to OFF on the filtered index table - what exactly would break?

+3


source to share


1 answer


The error message contains the key:

"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."

      

All of these functions require one set of canonical SET parameters. It is possible that for inserts into tables with filtered indexes, QUOTED_IDENTIFIERS might work, since as you say it only affects parsing of the query text. But one of these functions couldn't work with QUOTED_IDENTIFIERS.



And it can be as mundane as the fact that QUOTED_IDENTIFERS is such a weird duck * when parsing requests (and it's not recommended to disable it) that maintaining it in these scenarios just isn't worth the effort.

* see https://docs.microsoft.com/en-us/sql/t-sql/statements/set-quoted-identifier-transact-sql which explains the differences in session setup, its behavior in a special top-level batch , stored procedure and nested batch.

+2


source







All Articles