Internal Query Processor Error: The query processor could not produce a query plan. - by mrdenny

Status : 

  Duplicate<br /><br />
		This item appears to be a duplicate of another existing Connect or internal item.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


14
0
Sign in
to vote
ID 332815 Comments
Status Resolved Workarounds
Type Bug Repros 4
Opened 3/12/2008 5:21:14 PM
Access Restriction Public

Description

When doing a simple insert statement we are getting the "Internal Query Processor Error: The query processor could not produce a query plan." error.

We are running build 3042.
Sign in to post a comment.
Posted by mrdenny on 8/16/2010 at 3:50 PM
Can we get this one listed as a duplicate of 228950 so that it shows up as a child of it when that one is brought up.

Also is there any status update on either? The other item hasn't had an update since 2006.
Posted by David Morrissey on 12/22/2009 at 2:31 PM
I am working in SQL 2008 and got the same error:
"Msg 8624, Level 16, State 1, Line 13
Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."

I tried your recommended "set" workarounds and got the same results:
set ANSI_NULLS ON
set ANSI_PADDING ON
set ANSI_WARNINGS ON
set CONCAT_NULL_YIELDS_NULL ON
set NUMERIC_ROUNDABORT OFF
set QUOTED_IDENTIFIER ON
set ARITHABORT ON
declare @D datetime, @I uniqueidentifier, @A uniqueidentifier, @E uniqueidentifier
set @D = getdate()
set @I = newid()
set @A = newid()
set @E = newid()
INSERT INTO [msHR].[dbo].[Permission]
         ([PermissionID]
         ,[CreatedOn]
         ,[CreatedByID]
         ,[ModifiedOn]
         ,[ModifiedByID]
         ,[EmployeeID]
         ,[ObjectID]
         ,[ObjectTypeID]
         ,[PermissionTypeID]
         ,[RoleID]
         ,[ActiveOn]
         ,[ExpiresOn]
         ,[SecurityGroupID]
         ,[StateCodeID]
         ,[Recurse])
     VALUES
         (@I
         ,@D
         ,@A
         ,@D
         ,@A
         ,@E
         ,null
         ,null
         ,465
         ,null
         ,@D
         ,null
         ,null
         ,1
         ,0)

Here are the details of my environment:

Microsoft SQL Server Management Studio                        10.0.1600.22 ((SQL_PreRelease).080709-1414 )
Microsoft Analysis Services Client Tools                        2007.0100.1600.022 ((SQL_PreRelease).080709-1414 )
Microsoft Data Access Components (MDAC)                        2000.085.1132.00 (xpsp.080413-0852)
Microsoft MSXML                        2.6 3.0 4.0 5.0 6.0
Microsoft Internet Explorer                        7.0.5730.13
Microsoft .NET Framework                        2.0.50727.3603
Operating System                        5.1.2600
Posted by Microsoft on 3/13/2009 at 5:10 PM
Thank you for taking the time to report this issue.

This sounds like a duplicate of an issue we are already aware of, and for which a workaround is present. When you run the insert statement that fails to compile, please make sure that all the SET options required to create the persisted computed column on the primary table are enabled. Ideally, this should not be a requirement when inserting into the foreign table, but I hope it's an acceptable workaround for the time being.
The options in question are:

ANSI_NULLS –> ON
ANSI_PADDING –> ON
ANSI_WARNINGS –> ON
CONCAT_NULL_YIELDS_NULL –> ON
NUMERIC_ROUNDABORT –> OFF
QUOTED_IDENTIFIER –> ON
ARITHABORT –> ON (required only if the database is in 80 compatibility mode)

The issue is tracked by Connect Feedback ID : 228950

Please let us know if this turns out to not be the same issue.

Campbell Fraser,
SQL Development
Posted by mrdenny on 5/8/2008 at 3:23 PM
I've got another example of this if you would like me to post the object creation code. The error was resolved when I removed the foreign key constraints from the table throwing the error. This table was a linking table to allow for a many to many join.
Posted by mrdenny on 3/20/2008 at 11:57 AM
Sorry about that. I assume that my Source Control had the entire create script. I've scripted the object from Production as requested.

Neither table has indexed views or triggers on them.
Posted by Microsoft on 3/19/2008 at 3:57 PM
Thank-you for the update. Unfortunately the file does not contain the full create table statement, only a portion of it (see below).
We have tried with some sample tables but have been unable to get a repro.
A complete statement to create the table can be captured using Management Studio. Using the object browser, one can browse:
Server -> DatabaseName -> Tables
then right click on the table Account and choose "script Table as", "Create To...".

May I also ask if there are any dependent objects, e.g. indexed views or triggers, on either of the tables?

thanks,
Campbell Fraser, SQL Development

IF NOT EXISTS (SELECT * FROM sys.columns WHERE name = 'AccountMonitorTargetId' AND object_id=object_id('Account'))
BEGIN
ALTER TABLE Account
ADD AccountMonitorTargetId SMALLINT
END
GO
IF NOT EXISTS (SELECT * FROM sys.columns WHERE name = 'ActivationCode' AND object_id=object_id('Account'))
BEGIN
ALTER TABLE Account
ADD ActivationCode UNIQUEIDENTIFIER
END
GO
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE name = 'IX_Account_ActivationCode' AND object_id=object_id('Account'))
AND EXISTS (SELECT * FROM sys.columns WHERE name = 'ActivationCode' AND object_id=object_id('Account'))
BEGIN
CREATE INDEX IX_Account_ActivationCode ON dbo.Account
(ActivationCode)
WITH (FILLFACTOR=50)
END
GO
Posted by mrdenny on 3/18/2008 at 2:45 PM
I've attached the CREATE TABLE Script for the Account table.
Posted by Microsoft on 3/14/2008 at 2:35 PM
In order to validate we really need the dbo.Account table also (it may be the problem). Currently your CREATE TABLE has a foreign key that references this table, so we can't run your script as is unless we also have that table created.

Can you add the definition of the dbo.Account table to the bug description?

Thanks,
Eric
Posted by AaronBertrand on 3/13/2008 at 4:35 AM
In order to validate we really need the dbo.Account table also (it may be the problem). Currently your CREATE TABLE has a foreign key that references this table, so we can't run your script as is unless we also have that table created...
Posted by mrdenny on 3/12/2008 at 5:31 PM
I recreated the table and did not help.
Upgrading to build 3215 didn't help either.