This article is half-done without your Comment! *** Please share your thoughts via Comment ***
You can use xp_fixeddrives system stored procedure to find the free space SQL Server fixed Disks. The SQL Server admin can easily find the free space of disk by looking to file explorer of Server.
But we should use this stored procedure to set the automatic alert on free disk space of Server hard disk so that DBA can take the decisions accordingly. Due to insufficient free hard disk space, we can prevent the accidental failure or SQL Server.
Below is a small demonstration, I created a sample table to store the result of xp_fixeddrives procedure which we can use for a further alert.
Get the information of Server Disk free space:
1 |
EXEC xp_fixeddrives |
Create a sample table for storing the result of xp_fixeddrives:
1 2 3 4 5 6 |
CREATE TABLE tbl_SQLServerDiskFreeSpace ( drive text ,mbfree int ) GO |
Execute xp_fixeddrives and store the result in tbl_SQLServerDiskFreeSpace:
1 2 |
INSERT INTO tbl_SQLServerDiskFreeSpace EXEC xp_fixeddrives GO |