FIX: Select with ANSI Joins Against View with Union Operator and ANSI Joins Fails with Error 4409

This article was previously published under Q218834
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 18623 (SQLBUG_65)
SYMPTOMS
A SELECT statement, using ANSI-standard joins against a view defined using ANSI-standard joins and the UNION operator, may fail with this error:
Msg 4409, Level 20, State 1
The columns in the query definition and the view definition do not match.
The error occurs with SQL Server Service pack 5, build 6.50.416.
WORKAROUND
Here are three workarounds:
  • Change the query to use TSQL join syntax.

    -or-
  • Change the view definition to use TSQL join syntax.

    -or-
  • Remove the UNION operator from the view definition.
STATUS
Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in the Post Service Pack 5a Update for Microsoft SQL Server version 6.5. To install the Post Service Pack 5a Update, you must have either SQL Server 6.5 SP5 or SP5a installed.

For information about how to download and install the SQL Server 6.5 Service Pack 5a, refer to the following article in the Microsoft Knowledge Base:
197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a
If you already have SQL Server 6.5 SP5 or SP5a installed, you can download the Post SP5a Update from the following article in the Microsoft Knowledge Base:
274036 INF: How to Obtain SQL Server 6.5 Post Service Pack 5a Update
For more information, contact your primary support provider.
MORE INFORMATION
The following scenario demonstrates this problem:
CREATE TABLE dbo.Assignment (BUID int NULL )GOCREATE TABLE dbo.Project (ProjectID int NULL ,BUID int NULL)GOCREATE TABLE dbo.ProjectActual (ProjectID int NULL )GOCREATE VIEW V_UpdateProject ASSELECT Project.ProjectIDFROM Project INNER JOIN Assignment ON Project.BUID = Assignment.BUIDUNION SELECT Project.ProjectIDFROM ProjectGOSELECT V_UpdateProject.ProjectIDFROM V_UpdateProjectINNER JOIN ProjectActual ON V_UpdateProject.ProjectID = ProjectActual.ProjectID go				
The query fails with this error:
Msg 4409, Level 20, State 1
The columns in the query definition and the view definition do not match.
Properties

Article ID: 218834 - Last Review: 10/14/2013 19:40:05 - Revision: 4.0

  • Microsoft SQL Server 6.5 Service Pack 5a
  • kbnosurvey kbarchive kbbug kbfix KB218834
Feedback