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

How to get the Parameters of a Parameterized Query from dm_exec_sql_text

$
0
0

Hi,

When I am running the DMV to run the previously run Queries in Sql Azure

SELECT

sqltext.TEXT

FROM

sys.dm_exec_query_statsAS CP

CROSS

APPLYsys.dm_exec_sql_text(sql_handle)ASsqltext

I am getting the Text as below

(@var1, @Var2)  select  * from table where col1 = @var1 and col2 = @var2

I have tried joining with dm_exec_query_plan to get the values for @var1, @Var2  but Query_Plan does not provide me the latest Parameters but the cached one.

Please let me Know how can I find out the value of @var1, @Var2 .

Thanks,

Rajib


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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