Send Mail if Log file size exceeds 900

  • Hi All,

    I am executing a procedure in Job .

    I need to create a file for the O/P from the procedure.

    If the size of the file exceeds 900KB then i need to send a mail.

    So please help regarding this..

    Thanks,

    Pulivarthi

  • You can create an "Alert" which will notify the "Operator" when the log file size is >=900 KB. Here is an example.

    USE [msdb]

    GO

    EXEC msdb.dbo.sp_add_alert @name=N'TLogFull',

    @enabled=1,

    @delay_between_responses=0,

    @include_event_description_in=0,

    @performance_condition=N'SQLServer:Databases|Log File(s) Size (KB)||>|900'

    GO

    EXEC msdb.dbo.sp_add_notification @alert_name=N'TLogFull', @operator_name=N'TheOperatorName', @notification_method = 1

    GO

    This article is a good place to start with.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Hi,

    Thanks for help....

    Is there any way to find the size of the file using SQL /T-sql command .

    I am executing a procedure in step1 which O/P is inserting into \\......\....\filename.txt

    I want find out the size of the file which created by Step1 SP. based on this i have to go further business logic..

    Thanks,

    Pulivarthi

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

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