1 2 3 4 5 6 7 8 9 10
| SELECT q.query_id, t.query_sql_text, object_name(q.object_id) AS parent_object
FROM sys.query_store_query_text t JOIN sys.query_store_query q
ON t.query_text_id = q.query_text_id
WHERE t.query_sql_text LIKE N'%ZZTEST%' OR object_name(q.object_id) = 'ZZTEST'
query_id query_sql_text parent_object
133 SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 100 and id_col < 1000 UNION ALL SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 100 and id_col < 1000 order by id_col NULL
312 SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 1000 and id_col < 10000 UNION ALL SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 1000 and id_col < 10000 order by id_col NULL
349 SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 100 and id_col < 1000 UNION ALL SELECT * FROM [Test_new].[dbo].[ZZTest] where id_col > 100 and id_col < 1000 order by id_col NULL
350 SELECT q.query_id, t.query_sql_text, object_name(q.object_id) AS parent_object FROM sys.query_store_query_text t JOIN sys.query_store_query q ON t.query_text_id = q.query_text_id WHERE t.query_sql_text LIKE N'%ZZTEST%100%' NULL |
Partager