Quantcast
Channel: sqlsquirrel – The LockerGnome Daily Report
Viewing all articles
Browse latest Browse all 15

Quick Way To Determine Database File Size

$
0
0

Here is a quick snippet on how to determine the file size(s) of a specific database in SQL Server:

SELECT a.FILEID, CONVERT (decimal(12,2), ROUND (a.size / 128.000,2)) as [FILESIZEINMB],
CONVERT (decimal(12,2),ROUND (fileproperty (a.name,‘SpaceUsed’) / 128.000,2))  as [SPACEUSEDINMB],
CONVERT (decimal(12,2), ROUND ((a.size – fileproperty (a.name,‘SpaceUsed’)) /128.000,2)) as [FREESPACEINMB], a.name as [DATABASENAME], a.FILENAME as [FILENAME]
FROM dbo.sysfiles as a

The post Quick Way To Determine Database File Size appeared first on LockerGnome.


Viewing all articles
Browse latest Browse all 15

Trending Articles