Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Automated Email Alerts

$
0
0

I am trying to create a email alert script within sql server 2014 to send automated emails to users in which we set to get notified that the database is going over 80% disk usage space.

Please see what I have so far.....I need it to check and disk space and send an email alert and set it up to where it executes a scheduled job to complete twice a day at 8am and 6pm.

This is rather tough for me and haven't seem to really get far...here is what I have so far...


SELECT DISTINCT dovs.logical_volume_name LogicalName,

dovs.volume_mount_point Drive,

CONVERT(INT,dovs.available_bytes/1048576.0) FreeSpaceInMB

FROM sys.master_files mf

CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.FILE_ID) dovs

ORDER BY FreeSpaceInMB ASC

GO




Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>