Find Drive size and free space using TSQL

--
SELECT DISTINCT
  vs.volume_mount_point AS [Mount Point],
  vs.logical_volume_name AS [Mount Name],
  vs.total_bytes/1024/1024 AS [Size_MB],
  vs.available_bytes/1024/1024 AS [Free_Storage_MB]
FROM sys.master_files AS mf
CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.file_id) AS vs
ORDER BY vs.volume_mount_point;
--
--
Advertisements
This entry was posted in SQL, SQL Query and tagged , , , , . Bookmark the permalink.

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