FIX: Update Plan with User Defined Function May Fail to Find a Plan

Article translations Article translations
Article ID: 294787 - View products that this article applies to.
This article was previously published under Q294787
BUG #: 352705 (SHILOH_BUGS)
Expand all | Collapse all

SYMPTOMS

In some situations when you run either an INSERT, UPDATE, or DELETE statement with a SELECT statement that use a user defined function (UDF), the following error message may occur:
Server: Msg 8623, Level 16, State 1, Line 1
Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information.

RESOLUTION

To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

Alter the non-clustered primary key constraint to be a clustered primary key constraint.

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

To reproduce the error message, use this code:
INSERT test
(CaseId               
,SubCaseId            
,CaseIdleTime             
)
SELECT
sc.caseid AS CaseId,
sc.subcaseid AS SubCaseId,
convert(real,
    datediff(mi,
        dbo.udfGMTConvert(sc.SubCaseNonNotesLaborLogTime,s.GMTOffset),
        e.WarehouseEffectiveThroughTimeGMT 
    ) )
FROM 	dbo.vwcase c
JOIN 	dbo.vwsubcase sc
ON 	c.caseid = sc.caseid
JOIN    dbo.vwSource s on s.SourceId = c.SourceId
JOIN    dbo.vwWarehouseEffectiveThrough e on e.SourceId = c.SourceId
<BR/>
The constraint for the test table:<BR/>
ALTER TABLE [dbo].[test] WITH NOCHECK ADD 
	CONSTRAINT [PK_test_Fact] PRIMARY KEY NONCLUSTERED 
	(
		[CaseId],
		[SubCaseId]
	)  ON [PRIMARY] 
GO
				

Properties

Article ID: 294787 - Last Review: November 6, 2003 - Revision: 3.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbcodesnippet kbfix kbsqlserv2000sp1fix KB294787

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com