How do I get parameter values for SQL Server query in SQL Server Profiler

Adrian Grigore picture Adrian Grigore · Dec 23, 2009 · Viewed 33.5k times · Source

I'm trying to analyze a deadlock in SQL Server 2008 profiler. I know how to find the offending sql queries, but the collected queries do not include parameter values.

I other words I can see something like this:

DELETE FROM users WHERE id = @id

But what I would like to see is this:

DELETE FROM users WHERE id = 12345

I guess there are some additional events or Columns I need to collect in the profiler, but I don't know which. I am currently using the "TSQL_LOCKS" template.

Any hints would be greatly appreciated.

Thanks,

Adrian

Disclaimer: I've asked a similar question before, but I guess it was too specific, which is why I got no replies. I'm starting another attempt with this one.

Answer

davek picture davek · Dec 23, 2009

I think you need the RPC:Completed event:

http://msdn.microsoft.com/en-us/library/ms175543.aspx