How to find the Size of Database File and Log File

Hi Friends
               Here is the Sql Server Code which is used to find the size of DataBase and Log file.
CREATE PROCEDURE [dbo.GetSize]
 
AS
BEGIN
   
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) = 'Dbname'
 
END
 

1 comment: