1、查找目前SQL Server所执行的SQL语法,并展示资源情况:
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
2、展示耗时查询:
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
3、当前进程及其语句:
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
4、存储过程执行情况:
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
5、开销较大的查询:
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
6, 查询某个SPID,session_id对应的执行sql.
SQL code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
select er.session_id, cast(csql.text AS varchar(255)) AS CallingSQL from master.sys.dm_exec_requests er WITH (NOLOCK) CROSS APPLY fn_get_sql (er.sql_handle) csql where er.session_id =309 |
至尊箭神:http://www.zhizunjianshen.com/