New Official Documentation on Forced Parameterization
I love me some documentation.
For years, I’ve pointed folks to the SQL Server 2008 documentation on Forced Parameterization, a really useful tool for reducing plan cache bloat, getting more accurate reusable query plans, and enabling SQL Server 2019 and 2022’s Intelligent Query Plan features, many of which rely on the same query text coming in repeatedly over time in order to tune it. That documentation was pretty sparse, though.
Good news! There’s a new set of documentation on Forced Parameterization, and it goes into more details about:
- What kinds of literals are converted into parameters
- The exceptions: things you would expect to get converted, but won’t be, and will stop the whole statement from getting parameterized at all
- The partial-parameterization exceptions: things that won’t get converted, but other stuff in the query still will, leading the plan cache to continue to be a hot mess and stopping the IQP features from working on those queries
There’s also a foreboding warning:

At first blush, that sounds completely reasonable, but it carries a hidden connotation. If you’re using Query Store, and you expect the forced query to remain the same from patch to patch or version to version, it might not. I’ve never actually seen these things change, but Microsoft is saying they could, which is just another heads-up that forced query plans may not be forced anymore after a change like that. This might have even always been in the old docs – I just never noticed it before. Still, it seems reasonable to me. I’d love to see more investments in Forced Parameterization.
Also, technically, we don’t have Service Packs anymore, so I was a good community member and submitted a pull request to change that wording to Cumulative Updates. As a reminder, when you see a typo or outdated language in the docs, you can click the little three-dot icon at the top right, then click Edit, and you’ll be shoved over to Github to edit there and submit a pull request:

If you’ve never used Github before, the process is intimidating at first, but once you get used to it, it’s a piece of cake and you can submit edits in less than 30 seconds.
Related

Hi! I’m Brent Ozar.
I make Microsoft SQL Server go faster. I love teaching, travel, cars, and laughing. I’m based out of Las Vegas. He/him. I teach SQL Server training classes, or if you haven’t got time for the pain, I’m available for consulting too.
Get Free SQL Stuff
"*" indicates required fields

5 Comments. Leave new
Not to toot my own horn or anything, but we do have that article in review as I mentioned in the PR comment. When a customer raises an issue with content through a pull request, that small act bypasses several internal triage processes.
You’re kicking ass, and I appreciate your work! The quality really shows.
“Prepared statements that have already been parameterized on the client-side application.”
Which is great as long as it’s completely properly parameterized.
Thanks for the update Brent!
[…] Brent Ozar shares an update: […]