我使用下面的语句查询,虽然查到了历史 SQL 记录。
SELECT st.text as sql_statement,
qs.creation_time as plan_last_compiled,
qs.last_execution_time as plan_last_executed,
qs.execution_count as plan_executed_count,
qp.query_plan
FROM sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text(qs.plan_handle) st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp
order by total_elapsed_time/execution_count desc
但是由于我是参数化提交的 SQL 语句,所以只能查到类似 name=@name and phone=@phone 类型的语句。
有没有办法查到 @name @phone 的真正的值?