BUG: sp_MSdev_databases and sp_helpdb May DisagreeLast reviewed: April 28, 1997Article ID: Q88418 |
The information in this article applies to:
SYMPTOMSThe 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.
CAUSEsp_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.
STATUSMicrosoft 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:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |