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

This article was previously published under Q294787
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 352705 (SHILOH_BUGS)
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.
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 theMicrosoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
Alter the non-clustered primary key constraint to be a clustered primary key constraint.
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
To reproduce the error message, use this code:
INSERT test(CaseId               ,SubCaseId            ,CaseIdleTime             )SELECTsc.caseid AS CaseId,sc.subcaseid AS SubCaseId,convert(real,    datediff(mi,        dbo.udfGMTConvert(sc.SubCaseNonNotesLaborLogTime,s.GMTOffset),        e.WarehouseEffectiveThroughTimeGMT     ) )FROM 	dbo.vwcase cJOIN 	dbo.vwsubcase scON 	c.caseid = sc.caseidJOIN    dbo.vwSource s on s.SourceId = c.SourceIdJOIN    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				

Article ID: 294787 - Last Review: 01/16/2015 22:11:08 - Revision: 3.2

Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbcodesnippet kbfix kbsqlserv2000sp1fix KB294787