Database file size in MB in SQL Server 2005

I seen people ask in many forums that how can they find the size of their MDF and LDF file in MB by T-SQL so I thought to publish it here in my blog.

select ceiling(size/128) as ‘fileSizeinMB’,name as ‘filename’,physical_name from sys.database_files

It will return all available files for your database.


Reference: Ritesh Shah
http://www.sqlhub.com
Note: Microsoft Books online is a default reference of all articles but examples and explanations prepared by Ritesh Shah, founder of
http://www.SQLHub.com

Advertisements

2 Responses to “Database file size in MB in SQL Server 2005”

  1. Anonymous Says:

    Who knows where to download XRumer 5.0 Palladium? Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

  2. Anonymous Says:

    Who knows where to download XRumer 5.0 Palladium? Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: