Posted on 28th January 202315th April 2023Dynamically generated code T-SQL code can cause trouble A poorly written query can code trouble if the SQL server cannot predict a good execution plan because of too many type conversation and varchar max parameters: SQL Server CPU usage Dynamically generated T-SQL code After changing the code CPU usage after code changes