On SQL-Server 2016 (using Management Studio 2016), I created two identical stored procedures: one is compiled with SET QUOTED_IDENTIFIER OFF, the other one with ON.
Here is the query plan executed with ON, instant result, we can see the right index seek is used:
https://www.brentozar.com/pastetheplan/?id=S1ZNIpZ8z
And then this is where the problem lies, executed with OFF, it took more than 5 seconds with an index scan:
https://www.brentozar.com/pastetheplan/?id=SkCOUTWLf
Here are the DDL of the guilty indexes:
CREATE NONCLUSTERED INDEX [IX_CAB_NO_CAB_TYPE_CAB] ON [TraceTri].[CAB]
(
[NO_CAB] ASC,
[TYPE_CAB] ASC
)
CREATE NONCLUSTERED INDEX [IX_CAB_CHECKSUM] ON [TraceTri].[CAB]
(
[CHECKSUM] ASC
)
I don't understand how the query plan can be totally affected by this SET option, as it seems to have no link with the way it should be executed?