Wednesday, March 28, 2012

Finding database size in SQL Express

Our system guy wants me to find out just exactly how much room is being taken up by the SQL Express databases (I am using two). I am not sure how to do this. Is there any way to find the size, or, lacking that, how many records overall? We will probably need to move up to SQL 2005 soon, but he needs to figure out the memory requirements, etc.

Thanks,

Michael

try select [size] from sys.database_files

This will give you a row for each primary datafile and log, to get it all in one statement you could use

select Sum([size]) as total_file_size from sys.database_files

|||

Thanks, that worked.

Michael

No comments:

Post a Comment