Open for Voting

Provide VARBINARY form of sql_handle for (at least) truncated SQL Statements

Anywhere that SQL statements are displayed, if the statement is truncated for any reason, display the VARBINARY form of the sql_handle in a comment so that I can then attempt to get the full SQL Statement by pasting it into a query like:

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

DECLARE @Handle VARBINARY(64) = 0x02000000a7c7fd0d919abe9811febe229e974fd643f792150000000000000000000000000000000000000000;

SELECT [text] FROM sys.dm_exec_sql_text(@Handle);

This is a significant issue in systems queried from generated LINQ statements, which can be very lengthy.

For bonus points, automatically run that query with the appropriate value in the background in the appropriate instance and replace the truncated version of the SQL text with the complete version if it is found, either at the time the SQL text is captured in the repository or when it is displayed.

If there is a way to obtain that text using the hash that DPA uses for the SQL text, please provide that in some type of help text.

Note that in the new Deadlock tab, not even that hash value for the SQL is displayed.