记录在时间段内执行的所有SQL

时间:2021-08-03 15:46:30

In MS SQL Server 2008, I would like to investigate and tune the queries that are being executed by an application in a limited time interval. Can I, e.g. from SQL Server Management Studio, generate a log of all SQL being executed and how long time each query took (and which parameters they were executed with)?

在MS SQL Server 2008中,我希望研究并调优应用程序在有限的时间间隔内执行的查询。例如,我可以从SQL Server Management Studio生成正在执行的所有SQL的日志,以及每次查询花费了多长时间(以及使用了哪些参数)吗?

2 个解决方案

#1


3  

You can use Profiler for this purpose - from SSMS, go to Tools -> SQL Server Profiler.

您可以为此目的使用Profiler—从SSMS到Tools—> SQL Server Profiler。

#2


2  

You need to use the MS SQL Profiler to do this

您需要使用MS SQL分析器来完成此操作

http://msdn.microsoft.com/en-us/library/ms181091.aspx

http://msdn.microsoft.com/en-us/library/ms181091.aspx

#1


3  

You can use Profiler for this purpose - from SSMS, go to Tools -> SQL Server Profiler.

您可以为此目的使用Profiler—从SSMS到Tools—> SQL Server Profiler。

#2


2  

You need to use the MS SQL Profiler to do this

您需要使用MS SQL分析器来完成此操作

http://msdn.microsoft.com/en-us/library/ms181091.aspx

http://msdn.microsoft.com/en-us/library/ms181091.aspx