Is is possible to write a Query which checks all the disks for the
free disk space and give an email alert if the disk space goes below
the set threshold value?
As per your question i have bifurcated into two parts.
Is is possible to write a Query which checks all the disks for the
free disk space?
As per Pinal Dave Blog Here Through below mention TSQL query you can check your all disk drives space(in MB).
exec master..xp_fixeddrives;
Go
And give an email alert if the disk space goes below the set threshold
value?
As per schneider Blog Here Through stored procedure with scheduler job you can get SQL Server Disk Space Monitor Alerts
.
Note: - without testing in Test environment . Don't apply directly in Production environment.