I am writing a stored procedure that needs to send an email when a dvd rw drive is almost full. I found
master.sys.xp_fixeddrives
but it only shows free disk space for fixed hard drives. I have not been able to find something that will tell me the free space for "nonfixed" drives. Is there a undocumented sp or function that I don't know about?
Sql-server – Determine free space on “nonfixed” drive
sql servert-sql
Related Question
- Sql-server – UnShrunk SQL Server database restore which is larger than available disk space
- Sql-server – Log and Data Drive Configuration in VM environment
- Sql-server – Why is our SQL Server instance writing a thestery text file to our C: drive
- Sql-server – SQL Server 2016 out of disk space
- Sql-server – Running out of space, add new drive (add file to filegroup)
- Sql-server – DBCC CheckDB : Operating System Error 27(The drive cannot find the sector requested)
Best Answer
Alternative could be to use PowerShell to grab the information. All you need is a few commands tied together:
You could add in the logic to measure for your limit (value is in bytes). Then use Send-MailMessage cmdlet to actually send out your message. Wrap all that up and then have a SQL Agent job call the script on a scheduled basis.