Question : How to physical drive size using TSQL Queries in SQL Server 2005

I need to raise an alert when transaction log or data log has reached 80% of the threshold. For this I am extracting size from sys.database_files view for both Log and Data file. But in case if the size is un-restricted it shows "-1" in the "max_size" column. To overcome this I thought if max_size column contains "-1" then in that case if I get physical size of the drive on which .mdf or .ldf file is located then I can compute the percentage of space already used by SQL Server Data or the Log file.

Answer : How to physical drive size using TSQL Queries in SQL Server 2005

I've set up a job that sends an e-mail alert to users when free disk space fulls below a certain level.

The job has one step with the following TSQL

exec sp_diskalert '[email protected]', 1000
exec sp_diskalert '[email protected]', 500

If the free disk space fulls below 1GB the DBA's are mailed
If fulls below 500MB all users are mailed.
Random Solutions  
 
programming4us programming4us