• if @RecCount > 0 begin

    Msg 156, Level 15, State 1, Procedure usp_JobStepFailedAlert, Line 27

    Incorrect syntax near the keyword 'if'.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/