Azure SQL Database
An Azure relational database service.
5,119 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Enclosed picture shows different table name (missing the _ ). The actual table has the _ in the name, the query runs no problem, looks like SSMS is stripping the _ out
Maybe a previous version of SSMS shows it correctly.
As a workaround use the following query:
SELECT reason, score,
script = JSON_VALUE(details, '$.implementationDetails.script'),
planForceDetails.[query_id],
planForceDetails.[new plan_id],
planForceDetails.[recommended plan_id],
estimated_gain = (regressedPlanExecutionCount+recommendedPlanExecutionCount)*(regressedPlanCpuTimeAverage-recommendedPlanCpuTimeAverage)/1000000,
error_prone = IIF(regressedPlanErrorCount>recommendedPlanErrorCount, 'YES','NO')
FROM sys.dm_db_tuning_recommendations
CROSS APPLY OPENJSON (Details, '$.planForceDetails')
WITH ( [query_id] int '$.queryId',
[new plan_id] int '$.regressedPlanId',
[recommended plan_id] int '$.recommendedPlanId',
regressedPlanErrorCount int,
recommendedPlanErrorCount int,
regressedPlanExecutionCount int,
regressedPlanCpuTimeAverage float,
recommendedPlanExecutionCount int,
recommendedPlanCpuTimeAverage float ) as planForceDetails;
This query will return information about the queries and plans that regressed and T-SQL script that you can use to fix the issue.