question

SrgioTerenas-7683 avatar image
0 Votes"
SrgioTerenas-7683 asked AlbertoMorillo edited

SSMS 18.11.1 - Query Store Bug - Azure SQL Database

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
image.png (54.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AlbertoMorillo avatar image
0 Votes"
AlbertoMorillo answered AlbertoMorillo edited

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.