Fire Email Task Base on A Condition

  • Hello,

    Is it possible to fire an email task based on whether or not a SQL Server 2000 Table UDF or Proc returns records? I have a situation where I need a package to send an email only if records are returned from either a proc or UDF.

    Please share if you have any suggestions.

    Thank you for your help!

    CSDunn

  • You do not have to use email task, but use

    Exec Master..xp_sendmail  @recipients = @Precipients

            ,@message = @Pmessage

            ,@query = @Pquery

             ,@attachments = 'Data.xls'

             ,@subject = @Psubject

             ,@attach_results = 'TRUE'

             ,@width = 9999

             ,@separator = @sepchar

             ,@dbuse = @DBName

    You can call this proc after you check if SQL Server 2000 Table UDF or Proc returns records inside Execute SQL Task.

  • Thanks for your help!

    cdun2

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

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