如何在SQL Server中获取最昂贵查询的程序名称。 [英] How to get the program name of the most expensive queries in SQL server.

查看:140
本文介绍了如何在SQL Server中获取最昂贵查询的程序名称。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Folks,

Hello Folks,

我使用sys.dm_exec_query_stats来获取昂贵的查询。但它不包含程序触发它的信息。可以找到它。 

I am using sys.dm_exec_query_stats to get the expensive queries. But it does not contain information which program has triggered it. It is possible to find it. 

如果是,请告诉我相同的方法。

If yes, then let me know the way to get the same.

谢谢

Udham Singh

Udham Singh

推荐答案

不,SQL Server不会在查询计划中存储应用程序名称。它不起作用,缓存机制。您的选择是运行扩展事件跟踪并捕获相关信息(如查询哈希)并将跟踪数据
与缓存计划相关联(或者当然使用跟踪)。
No, SQL Server doesn't store the application names along the query plans. It doesn't work that way, the caching mechanism. Your option would be to run an extended event trace and capture relevant information (like query hash) and correlate that trace data with the cached plans (or use the trace on its own, of course).


这篇关于如何在SQL Server中获取最昂贵查询的程序名称。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆