FIX: NUMERIC Data Returned as FLOAT by RPC Call

Last reviewed: February 1, 1999
Article ID: Q190126


The information in this article applies to:
  • Microsoft SQL Server versions 6.0, 6.5

BUG #: 18157 (6.5)

SYMPTOMS

When executing a stored procedure that returns NUMERIC or DECIMAL data on a remote server by means of server to server remote procedure call (RPC), those data types will be returned with a type of FLOAT. This may result in loss of precision for high numeric values.

The following example demonstrates the effects of this problem:

   On Server1, create the following stored procedure:

         CREATE PROCEDURE numproc AS select 1234567890123456789.0

   Calling "EXEC numproc" on Server1 returns the expected result:

         1234567890123456789.0

   However, calling the stored procedure from a remote server, by using a
   statement such as "EXEC Server1...numproc" returns the following:

         1.234567890123456e+018

CAUSE

A server doing an RPC call logs in to the remote server as a SQL Server 4.2 client (because a remote server could also be a SQL Server 4.2 server, which would not understand SQL Server 6.0 or 6.5 login packets). However, a SQL Server 6.0 or 6.5 server returns NUMERIC data as FLOAT to SQL Server 4.2 clients because the NUMERIC data type was not available with SQL Server 4.2.

WORKAROUND

To work around this problem, convert NUMERIC data to VARCHAR when returned by a stored procedure that might also be called remotely.

STATUS

Microsoft has confirmed this to be a problem in SQL Server versions 6.0 and 6.5. For SQL Server 6.5, this problem has been corrected in the latest U.S. Service Pack for SQL Server version 6.5. For more information, contact your primary support provider.


Additional query words: datatype datatypes SP sp5 st proc sproc

Keywords : kbbug6.00 kbbug6.50 kbfix6.50.sp5
Version : winnt:6.0,6.5
Platform : winnt
Issue type : kbbug
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 1, 1999
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.