FIX: Nullability Changes Not Handled by SQL Server with Linked Server Queries to DB2 (293758)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 7.0

This article was previously published under Q293758
BUG #: 351698 (SHILOH_bugs)
BUG #: 101204 (SQLBUG_70)

SYMPTOMS

The OLEDB provider for DB2 is unable to reliably determine the NULLABILITY of a column. Because the driver is unable to determine the NULLABILITY of a column, in some OpenQuery cases, the provider returns DBCOLUMNFLAGS_ISNULLABLE=0 (which means non-NULLable) when the query is prepared; however, the actual data indicates ISNULLABLE=1.

SQL Server relies on the NULLABILITY of column information for optimization and detects the mismatch at execution time, which then causes this error message to occur:
OLE DB provider 'DB2OLEDB' supplied inconsistent metadata for a column. Metadata information was changed at execution time

RESOLUTION

SQL Server 2000

To resolve this problem, obtain the latest service pack for Microsoft 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

SQL Server 7.0

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack

NOTE: The following hotfix was created prior to Microsoft SQL Server 7.0 Service Pack 4.

The English version of this fix should have the following file attributes or later:
   File name   Platform
   ----------------------

   s70980i.exe  X86
   s70980a.exe  Alpha
				
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

SQL Server 2000
This problem was first corrected in SQL Server 2000 Service Pack 1.

SQL Server 7.0
This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.

MORE INFORMATION

This fix was performed for both SQL Server and the DB2 provider to determine the nullability properly. If the DB2 provider returns MAYBENULL at compile time, SQL Server does not error out at execution time if ISNULLABLE is set to 0 or 1, if it was previously MAYBENULL.

In order to get this issue addressed completely, you must obtain the DB2 provider fix in addition to this SQL Server fix. Details on the provider fix can be found in the following Microsoft Knowledge Base article:

287761 DB2OLEDB Provider Does Not Always Determine Nullability Of Data


Modification Type:MajorLast Reviewed:10/31/2003
Keywords:kbBug kbfix kbQFE kbSQLServ2000sp1fix KB293758