INF: SQL Enterprise Manager Rounds Database Size (268784)



The information in this article applies to:

  • Microsoft SQL Server 6.5
  • Microsoft SQL Server 7.0
  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q268784

SUMMARY

The properties pane for a database in the SQL Enterprise Manager (SEM) displays the database size rounded to whole megabytes. For example, if the database size is actually 1.5 MB, it displays as 2 MB.

MORE INFORMATION

This behavior is by design. SQL Distributed Management Objects (DMO) returns an integer, not a floating-point value. Consider the following example:
CREATE DATABASE test
ON 
( NAME = test_dat,
  FILENAME = 'c:\mssql7\data\test.mdf',
  SIZE = 1693 KB
  )
LOG ON
( NAME = test_log,
  FILENAME = 'c:\mssql7\data\test.ldf',
  SIZE = 1135 KB
)
				
When the preceding statements are run Query Analyzer returns:

The CREATE DATABASE process is allocating 1.69 MB on disk 'test2_dat'.
The CREATE DATABASE process is allocating 1.13 MB on disk 'test2_log'.
				
However, the SQL Enterprise Manager returns whole database sizes, rounded off to the closest integer value.

Use the SQL Query Analyzer to get more accurate fractional database sizes.

The database size returned is an accurate floating-point number when you use the following in SQL Query Analyzer:
sp_helpdb 'DB_NAME'
				

-or-

use 'DB_NAME'
sp_spaceused
				

Modification Type:MajorLast Reviewed:11/14/2003
Keywords:kbinfo kbpending KB268784