dm_exec_text_query_plan returns too much statement text - by Erland Sommarskog

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 379398 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/1/2008 12:29:16 PM
Access Restriction Public


When you use dm_exec_text_query_plan and specify start and end offsets to only get the plan for a specific statement, the attribute StmtSimple:StatementText includes all text from the beginning of the batch up to the end of the statement. I would expect to get only the text for the statement.

If you convert the plan to XML and open it in SSMS, and the procedure is very long you get an immense popup. Also, if you run a query against a remote server, this means that you return a lot of extra bytes.
Sign in to post a comment.
Posted by Microsoft on 11/11/2008 at 6:07 PM
Hello Erland,

Thank you for reporting this defect! Indeed we have a problem outputting the text from the beginning of the batch to the end of the statement. This defect is to be triaged for the next public cumulative update of SQL Server 2008. At this point in time I cannot provide more specific information about when the fix will be available.

If this causes significant problems you may pursue the hotfix (QFE) route.