SSMS 18.11.1 - Query Store Bug - Azure SQL Database

Sérgio Terenas 1 Reputation point
2022-05-24T21:10:21.633+00:00

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
205185-image.png

205214-ssms.png

Azure SQL Database
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 32,886 Reputation points MVP
    2022-05-24T21:33:04.36+00:00

    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.

    0 comments No comments