views:

60

answers:

2

Hi,

I'm trying to debug a deadlock with SQL Server Profiler 2008. I know how to get a graph of the deadlock in the profiler, but when I hover over one of the two statements in shown in the graph, the "Statement" tooltip that appears only contains the query with parameter names, not values.

In other words I get tooltips like this:

DELETE FROM users WHERE id = @id

How can I see the corresponding parameter values? This screenshot shows what I would like to see, so there must be a way.

+1  A: 

If you're collecting the Statement Begin events in your trace, you should be able to tie them together quite easily.

But also check to see if the parameter values are specified in the XML, which you can easily extract from Profiler.

Rob Farley
+2  A: 

Your best bet is probably to also include "SQL:StatementStarting" in your profile and then just scroll up the list looking for the SPIDs that were part of the deadlock. That's not an easy way to do it, but SQL Profiler records the statements differently if they were parameterized SQL vs. a regular statement. In your photo, it looks like it's showing a non-parameterized statement, but your question seems to be about one that's parameterized.

I've had this problem before with trying to figure out exactly what an application was sending to SQL Server - all I could see was the parameterized query, and that wasn't helping me at all.

rwmnau