FIX: Cannot Execute SELECT COUNT(*) Against DB2 on Mainframe Using Four-Part Name (296685)
The information in this article applies to:
- Microsoft Host Integration Server 2000
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q296685
BUG #: 352492 (SHILOH_BUGS)
SYMPTOMS
When you execute a SELECT COUNT(*) statement to retrieve the count of all records in a table against a linked DB2 server on a mainframe that is using it's four-part name, the following error message occurs:
Server: Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing a query for execution against OLE DB provider 'DB2OLEDB'.
[OLE/DB provider returned message: A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 42601, SQLCODE: -104]
CAUSE
SQL Server parses a SELECT COUNT(*) statement as SELECT COUNT((0)) for all providers. This can be observed by creating a DB2 internal trace in the Trace utility that is provided with Microsoft SNA Server 4.0 and Host Integration Server 2000.
The OS/390 version of DB2 server that runs on a mainframe cannot work with the format of SELECT COUNT((0)) and causes the error message to occur.
RESOLUTIONTo 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 the
Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
STATUSMicrosoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
Modification Type: | Major | Last Reviewed: | 4/9/2004 |
---|
Keywords: | kbBug kbfix kbSQLServ2000sp1fix KB296685 |
---|
|