FIX: UPDATE of Table Column with a FOREIGN KEY Constraint May Fail with Msg 8623

Article translations Article translations
Article ID: 214818 - View products that this article applies to.
This article was previously published under Q214818
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 53943 (SQLBUG_70)
Expand all | Collapse all

SYMPTOMS

Attempting to update a column using a declared variable may fail if that column has a FOREIGN KEY (FK) constraint and the FROM clause references multiple tables. In such cases, the following error message occurs:
Server: Msg 8623, Level 16, State 2, Line 8
Internal Query Processor Error: The query processor could not produce a query plan.
For example, the following would cause the error:
declare @c1 int
select @c1 =
   update secondary_tbl set c1 = @c1
   from secondary_tbl p,child_1 t1, child_2 t2
   where  p.s1 = t1.s1
				

WORKAROUND

To work around this problem, use CONVERT to cast the variable to its data type. In the preceding example, replace:
update secondary_tbl set c1 = @c1
				

with:
update secondary_tbl set c1 = convert(int,@c1)
				

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

Properties

Article ID: 214818 - Last Review: October 14, 2013 - Revision: 2.1
APPLIES TO
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB214818

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