Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

sys.dm_exec_query_stats and sys.dm_exec_sql_text not giving correct query text

$
0
0

When I execute the following query, I see that some of the rows show create function definition instead of the code that called the functions. for e.g I would like to know what parameters were used when the function was called. I can't seem to find this information. What could I be missing? 

SELECT ST.text  FROM sys.dm_exec_query_stats QS
CROSS APPLY sys.dm_exec_sql_text(QS.Sql_Handle) as ST
Where ST.dbid = 5
Order BY QS.total_elapsed_time desc


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>