When using Simple Parameterization in the AdventureWorks database, you can execute the following query:
USE [AdventureWorks2022]
GO
SET QUOTED_IDENTIFIER OFF
SELECT "True" FROM Person.Person WHERE FirstName = "John"
SET QUOTED_IDENTIFIER ON
However, when you enable Forced Parameterization, this same query fails with:
“Invalid column name ‘True’.”
If you remove the the ‘SET QUOTED_IDENTIFIER ON’ at the end it succeeds, or if you add a GO after the SELECT, it also succeeds.
Is this something to do with how Forced Parameterization works? Just looking for an explanation so I can better understand it.
Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.