虽然 SQL Server Express 不带 Profiler,也是有办法来监控的,用下面语句即可:
select substring(st.text, (qs.statement_start_offset/2)+1
, ((case qs.statement_end_offset
when -1 then datalength(st.text)
else qs.statement_end_offset
end - qs.statement_start_offset)/2) + 1) as statement_text
,
qs.creation_time
from sys.dm_exec_query_stats as qs
cross apply sys.dm_exec_sql_text(qs.sql_handle) as st
order by qs.creation_time desc