Monday, February 8, 2010

How to find the Size of Database File and Log File

Hi all,
I just went through Pinal Dave's Blog Today and found a very simple script for finding out the Database File Size and the Size of the Log file.Here it how it goes :

SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) = 'AdventureWorks'
GO

For detailed post you can visit here


Thanks Pinal for such a wonderful script..



Thanks ,

Nitin Sharma