79726643

Date: 2025-08-05 22:23:30
Score: 1
Natty:
Report link

This is not an answer, but has been removed from the question, and I consider this information important enough to include.

If you have parameter sensitivity (parameter sniffing problem), which is what I had, starting from SQL Server 2016, it is possible to disable Parameter Sniffing via ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)

The command is

ALTER DATABASE SCOPED CONFIGURATION SET PARAMETER_SNIFFING = OFF;

Be aware that this setting will disable parameter sniffing for ALL queries in the database, not a particular set. This would solve my problem if it did not affect other unrelated queries.

Reasons:
  • Blacklisted phrase (1): not an answer
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Mykola