Forced parameterization recommendation in Azure

Parvinder Tomar 146 Reputation points
2022-08-15T12:23:43.387+00:00

I am using the Azure SQL database; I received a recommendation that- Non-Parameterized queries are causing performance issues.

Right now, we do not have any stored procedure on this database, do you recommend turning on the forced parameterization option over changing the application queries into stored procedures?

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 32,796 Reputation points MVP
    2022-08-15T14:03:56.68+00:00

    As a temporary workaround, use Forced Parameterization. This is a workaround for applications that don't properly parameterize queries. It's better to use parameters for frequently-run queries, and hard-coded values where you want the plan to be based on individual value. Use the following statement to enable the workaround while you fix the queries or create stored proedure with parameters on the queries.

    ALTER DATABASE [TestDB] SET PARAMETERIZATION FORCED  
    

    Please read this article on how to parameterize your queries.

    0 comments No comments