Show Actual Query Plan causes error - by Vendoran

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<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 785151 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 4/19/2013 11:27:44 AM
Access Restriction Public


When I run the following query in SQL 2008 R2 and in SQL 2012 with Show Actual Query Plan turned off, the results are as expected.  However when run in SQL 2012 with Show Actual Query Plan turned on - an error is returned with a result of NULL

More info at
Sign in to post a comment.
Posted by RAdamMartin on 8/21/2015 at 12:25 PM
Also note there is no try/catch block in my sp, just the if exists lines and then exec statements selecting a view into each of the dropped tables. (i.e. if table1 exists drop table1; exec('select * from view1 into table1);, etc.)
Posted by RAdamMartin on 8/21/2015 at 12:22 PM
Running SQL2012 SP2 and reproducing this error using a different query (my query is encapsulated within a stored procedure). The line in the sp that it fails on is "IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = @DS) EXEC ('DROP TABLE ' + @DS)". However, this line is called many times previously with different @DS values, and was working earlier. The value for DS that it fails on is 'APS_6_OpAttributes', though all table names are of a similar format.
Posted by Jay [MSFT] on 9/22/2014 at 1:16 PM
This is fixed in SQL2012 SP2. Thanks.
Posted by OldNerdKMC on 7/28/2014 at 10:37 AM
Was the fix for this released in a CU or Hotfix?
Posted by Manbeen [MSFT] on 1/5/2014 at 6:11 PM
Thanks for submitting this feedback. This issue has been resolved and a fix will be available in an upcoming servicing release for SQL Server 2012. We will update you when the fix has been shipped. Thanks again for your continued support in SQL Server.
Posted by Jay [MSFT] on 10/8/2013 at 10:32 AM
For INSERT EXEC, statistics XML used to be unavailable with earlier version of SQL server. As a part of better usability, we added such support for SQL 2012, but missed a couple of cases including your scenario. This issue will be fixed in the next service pack.
Thank you very much for your feedback, and making SQL server better.
Posted by Microsoft on 4/29/2013 at 4:46 PM
Hello Vendoran. Thank you for bringing this to our attention. We really do appreciate the feedback. We’ll investigate and get back to you. -Walter A Jokiel, Program Manager, SQL Server (