FIX: ODS Function Srv_describe May Fail on Certain Type Conversions

This article was previously published under Q246607
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 55909 (SQLBUG_70)
Symptoms
The Open Data Services (ODS) function srv_describe must be used in an ODS application or an extended stored procedure to set the characteristics (name and data type) of a column of the result set returned to the client. The function also defines the data type of the data source. If the source and target data types differ, an implicit data conversion takes place when sending a row of the result set by calling srv_sendrow.

However, srv_describe incorrectly returns FAIL if the source data type is not a fixed length data type and the length of the source data field is greater than the maximum length of the target data type.

For example, the following call to srv_describe will return FAIL:
   srv_describe (srvproc, 1, "Col", -1, SRVINT4, 0, SRVCHAR, 5, "12345")				
Whereas the following call succeeds because the source data length matches the maximum length of the target type SRVINT4, which is 4:
   srv_describe (srvproc, 1, "Col", -1, SRVINT4, 0, SRVCHAR, 4, "1234")				
Workaround
To work around this problem, use identical source and target data types in srv_describe and where necessary perform an explicit data conversion using srv_convert before each call to srv_sendrow.
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.
xp xps xproc xprocs datatype datatypes
Properties

Article ID: 246607 - Last Review: 10/26/2013 04:53:00 - Revision: 3.0

  • Microsoft SQL Server 7.0 Standard Edition
  • kbnosurvey kbarchive kbbug kbfix KB246607
Feedback