sql-query-store

How to find which Program or User executed Query using Query Store in SQL Server 2016+

二次信任 提交于 2019-12-24 05:02:25
问题 After enabling query store, how to find who executed the query. For example, in case of trace collection, there is TRC file which will get the hostname and program details for query and in case of Extended-Events, we have XEL file which will get the hostname and program details. We tried code SELECT des.program_name, des.host_name, * FROM sys.query_store_query_text qt -- Query Text JOIN sys.query_store_query q ON qt.query_text_id = q.query_id -- Query Data JOIN sys.query_store_plan qp on qp

How to find which Program or User executed Query using Query Store in SQL Server 2016+

半世苍凉 提交于 2019-12-24 05:02:21
问题 After enabling query store, how to find who executed the query. For example, in case of trace collection, there is TRC file which will get the hostname and program details for query and in case of Extended-Events, we have XEL file which will get the hostname and program details. We tried code SELECT des.program_name, des.host_name, * FROM sys.query_store_query_text qt -- Query Text JOIN sys.query_store_query q ON qt.query_text_id = q.query_id -- Query Data JOIN sys.query_store_plan qp on qp