我正在尝试使用 SQL Server Profiler 2008 调试死锁。我知道如何在分析器中获取死锁图,但是当我将鼠标悬停在图中所示的两个语句之一上时,“语句”工具提示仅包含带有参数名称的查询,而不是值。
换句话说,我得到这样的工具提示:
DELETE FROM users WHERE id = @id
如何查看对应的参数值?这个截图:
我正在尝试使用 SQL Server Profiler 2008 调试死锁。我知道如何在分析器中获取死锁图,但是当我将鼠标悬停在图中所示的两个语句之一上时,“语句”工具提示仅包含带有参数名称的查询,而不是值。
换句话说,我得到这样的工具提示:
DELETE FROM users WHERE id = @id
如何查看对应的参数值?这个截图:
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.