如何在 SQL Server Management Studio 中查看已执行的查询?
问题描述:
我是 SQL Server Management Studio 的新手,想知道:有没有办法查看对数据库运行了哪些查询?
I am new to SQL Server Management Studio and am wondering: is there is a way to see which queries have been run against a database?
在活动监视器中,有一个最近昂贵的查询"报告,但我猜这不是所有查询,因为我没有看到我运行的查询.
In the Activity monitor, there is a "Recent Expensive Queries" report but I'm guessing that isn't all of the queries since I'm not seeing the ones I have run.
我正在运行 SQL Server Express 2008 v 10.0.1600.22.
I am running SQL Server Express 2008 v 10.0.1600.22.
答
使用 SQLProfiler 并对其使用过滤器来获取最昂贵的查询.
Use SQL Profiler and use a filter on it to get the most expensive queries.