FIX: ODS Function Srv_describe May Fail on Certain Type Conversions

Article translations Article translations
Article ID: 246607 - View products that this article applies to.
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)
Expand all | Collapse all

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.

Properties

Article ID: 246607 - Last Review: October 26, 2013 - Revision: 3.0
Applies to
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB246607

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com