Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Actual values instead of variables

Author  Topic 

zni
Starting Member

1 Post

Posted - 2010-06-10 : 15:02:09
This is probably a simple question...

I want to see the actual values instead of variables in the SQL statement. See the above example. How can I find the values for the parameters @P1 and @P2?

T-SQL:

select dest.*
from sys.dm_exec_requests as der
cross apply sys.dm_exec_sql_text (der.sql_handle) as dest
where session_id = spid

Output:

(@P1 nvarchar(8),@P2 nvarchar(26))SELECT TOP 1 A.NUMBERSEQUENCE,A.TXT,A.LOWEST,A.HIGHEST,A.NEXTREC,A.BLOCKED,
A.FORMAT,A.CONTINUOUS,A.CYCLIC,A.CLEANATACCESS,A.INUSE,
A.NOINCREMENT,A.CLEANINTERVAL,A.LATESTCLEANDATE,
A.LATESTCLEANTIME,A.ALLOWCHANGEUP,A.ALLOWCHANGEDOWN,
A.MANUAL,A.FETCHAHEADQTY,A.FETCHAHEAD,A.MODIFIEDTRANSACTIONID,
A.RECVERSION,A.RECID FROM NUMBERSEQUENCETABLE A WITH( UPDLOCK) WHERE ((DATAAREAID=@P1) AND (NUMBERSEQUENCE=@P2))

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-10 : 15:03:55
You'd have to trace for it in SQL Profiler.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -