BUG: sp_MSdev_databases and sp_helpdb May Disagree

Last reviewed: April 28, 1997
Article ID: Q88418

The information in this article applies to:
  • Microsoft SQL Server version 4.2 for OS/2
BUG# 7447 (4.2)

SYMPTOMS

The stored procedure sp_MSdev_databases, used by SQL Administrator, may return different results for a database's size than does the stored procedure sp_helpdb.

SQL Administrator uses sp_MSdev_databases when you double-click a device name to get detailed information about the databases that reside on that device.

If the database size contains a fraction of a megabyte (for example, 10.5 MB), sp_MSdev_databases returns a database size of 10 MB while sp_helpdb returns 11 MB.

CAUSE

sp_MSdev_databases uses the following formula to calculate the database size:

   round ((sum(size) * 2048) / 1048576) , 1)

As you can see, sp_MSdev_databases uses integer arithmetic. It drops the remainder of the division and rounds the database size down.

sp_helpdb uses the following formula to calculate the database size:

   round ((2048 * convert(float, sum(size))) / 1048576, 1)

As you can see, sp_helpdb converts the database size to a floating-point number and uses floating-point arithmetic, so the remainder of the division is not dropped.

STATUS

Microsoft has confirmed this to be a problem in SQL Administrator version 4.2. We are researching this problem and will post new information here as it becomes available.


Additional query words:
Keywords : kbbug4.20 kbtool SSrvSAF SSrvSQL_Admin
Version : 4.2
Platform : OS/2


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: April 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.