Microsoft KB Archive/88418

{|
 * width="100%"|

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.
 * }

-

Last reviewed: April 28, 1997

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.