Database Size Notification

  • Respected All

    Is there any way to get notified when DB Size crosses a particular size limit in sql server 2005 Express Edition

    SQL SERVER Express Edition size is 4 GB but some time we did not monitor size and application generates error.

    Thanks

    Ghanshyam

  • There's probably a better way, but this should work:

    select count(*)

    frommaster.sys.databasesas DB

    inner joinmaster.sys.master_filesas MF on MF.database_id = DB.database_id

    where DB.name = 'Express_DB'

    and MF.name = 'Express_Data'

    and (MF. /131072.) >3.5

    if @@rowcount > 0

    EXEC msdb.dbo.sp_send_dbmail

    @recipients = 'YourName@YourCompany.com',

    @subject = 'Express Database over 3.5 Gig'

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply