I'm running the following statement to see what queries are executing in sql server:
select *
from sys.dm_exec_requests r
cross apply sys.dm_exec_sql_text(r.sql_handle)
where r.database_id = DB_ID('<dbname>')
The sql text that comes back is parameterized:
(@Parm0 int) select * from foo where foo_id = @Parm0
Is there any way to get the values for the parameters that the statement is using? Say by joining to another table perhaps?