question

trequonw avatar image
trequonw asked

Email Alert Scipt

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

sql server 2014scriptemailalertsdisk-space
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.