Microsoft KB Archive/942704

From BetaArchive Wiki

Article ID: 942704

Article Last Modified on 1/2/2008



APPLIES TO

  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems



Bug: #50001861 (SQL Hotfix)

SYMPTOMS

Consider the following scenario:

  • In a Microsoft SQL Server 2005-based application, you use the SQL Native Client ODBC provider to connect to an instance of SQL Server 2005.
  • You enable the prepared execution by calling the SQLPrepare function.
  • You use the SQLDescribeParam function in the application.

When the SQLDescribeParam function returns an error message, all the later commands are ignored unexpectedly.

For example, when a statement in an application generates the following error message when you call the SQLDescribeParam function, the later commands in the application are ignored:

Native error: 207 Message: [Microsoft][SQL Native Client][SQL Server]Invalid column name ColumnName.

In this example, if you use SQL Server Profiler to capture a SQL Server trace, you find events that resemble the following:

SQL:BatchStarting        SET FMTONLY ON select c1 from tab where 1=2 SET FMTONLY OFF
SQL:StmtStarting        SET FMTONLY ON
SQL:StmtCompleted       SET FMTONLY ON
SQL:StmtStarting        select c1 from tab where 1=2 
Exception           Error: 207, Severity: 16, State: 1
User Error Message      Invalid column name 'c1'.
SQL:BatchCompleted      SET FMTONLY ON select c1 from tab where 1=2 SET FMTONLY OFF

CAUSE

This issue occurs because the SQL Native Client ODBC provider sends the following statement to SQL Server to query the metadata when the prepared execution is used in the application:

SET FMTONLY ON
SELECT <ColumnName> FROM <TableName> WHERE 1=2
SET FMTONLY OFF

In the statements, when the SELECT statement returns an error, the SET FMTONLY OFF statement is not executed. Therefore, later statements are ignored.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next SQL Server 2005 service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

Prerequisites

No prerequisites are required.

Restart information

You do not have to restart the computer after you apply this hotfix.

Registry information

You do not have to change the registry.

Hotfix file information

This hotfix contains only the files that are required to correct the issues that this article lists. This hotfix may not contain all the files that you must have to fully update a product to the latest build.

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

SQL Native Client, 32-bit version
File name File version File size Date Time Platform
Sqlncli.dll 2005.90.3215.0 2,234,904 09-Dec-2007 14:59 x86
Sqlnclir.rll 2005.90.1399.0 205,528 14-Oct-2005 02:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
SQL Native Client, x64-based version
File name File version File size Date Time Platform
Sqlncli.dll 2005.90.3215.0 2,755,608 09-Dec-2007 01:05 x64
Sqlnclir.rll 2005.90.1399.0 206,040 14-Oct-2005 13:31 x64
Sqlncli.dll 2005.90.3215.0 2,234,904 09-Dec-2007 14:59 x86
Sqlnclir.rll 2005.90.1399.0 205,528 14-Oct-2005 02:48 x86
Msvcm80.dll 8.0.50727.42 516,096 22-Sep-2005 23:27 x64
Msvcp80.dll 8.0.50727.42 1,097,728 22-Sep-2005 23:28 x64
Msvcr80.dll 8.0.50727.42 822,784 22-Sep-2005 23:26 x64
Msvcm80.dll 8.0.50727.42 516,096 22-Sep-2005 23:27 x64
Msvcp80.dll 8.0.50727.42 1,097,728 22-Sep-2005 23:28 x64
Msvcr80.dll 8.0.50727.42 822,784 22-Sep-2005 23:26 x64
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
SQL Native Client, Itanium-architecture version
File name File version File size Date Time Platform
Sqlncli.dll 2005.90.3215.0 5,421,080 09-Dec-2007 05:34 IA64
Sqlnclir.rll 2005.90.1399.0 205,016 14-Oct-2005 13:39 IA64
Sqlncli.dll 2005.90.3215.0 2,234,904 09-Dec-2007 14:59 x86
Sqlnclir.rll 2005.90.1399.0 205,528 14-Oct-2005 02:48 x86
Msvcm80.dll 8.0.50727.42 572,416 22-Sep-2005 23:29 IA64
Msvcp80.dll 8.0.50727.42 1,385,472 22-Sep-2005 23:31 IA64
Msvcr80.dll 8.0.50727.42 1,484,800 22-Sep-2005 23:28 IA64
Msvcm80.dll 8.0.50727.42 572,416 22-Sep-2005 23:29 IA64
Msvcp80.dll 8.0.50727.42 1,385,472 22-Sep-2005 23:31 IA64
Msvcr80.dll 8.0.50727.42 1,484,800 22-Sep-2005 23:28 IA64
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86
Msvcm80.dll 8.0.50727.42 479,232 22-Sep-2005 23:48 x86
Msvcp80.dll 8.0.50727.42 548,864 22-Sep-2005 23:48 x86
Msvcr80.dll 8.0.50727.42 626,688 22-Sep-2005 23:48 x86



WORKAROUND

To work around this issue, use one of the following methods:

  • Avoid error conditions for the statement that is specified in the application.
  • Avoid using the prepared execution if you call the SQLDescribeParam function in the application.
  • Avoid using the SQLDescribeParam function if you use the prepared execution in the application.


STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Note This issue applies to the ODBC driver for SQL Server and to the SQL Native Client ODBC provider. However, the issue is currently only corrected in the SQL Native Client ODBC provider. The library file of the ODBC driver for SQL Server is Sqlsrv32.dll. The library file of the SQL Native Client ODBC provider is Sqlncli.dll.

MORE INFORMATION

For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:

822499 New naming schema for Microsoft SQL Server software update packages


For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Keywords: kbsqlclient kbsql2005connect kbfix kbpubtypekc kbqfe kbexpertiseadvanced kbhotfixserver KB942704