Need Proc Results to Drive Package Execution

  • Hello,

    I have a situation in which I need the result set of a stored procedure to determine the steps taken in a DTS package. Currrently the proc returns zero or more records. If the proc returns no records, then I want to disable the next steps in the package and stop the package. If records are returned, then the package needs to continue, and the results need to be delivered in an email message via xp_sendmail.

    I'm okay with creating the sql task to implement xp_sendmail. Normally, I would set up a table UDF, execute it in a sql task, count the records returned and go from there. I can't do this in a UDF because I'm having to use date functions.

    How would do this using a proc? Does the proc need an output parameter? If you need to see the code for the proc, please let me know.

    Thank you for your help!

    CSDunn

  • I believe you got this one right.  Probably easiest to use the recordcount as the output parameter and procede from there.

    Regards,
    Matt

  • Thanks for the response. I'm trying this from another angle, and I've run into some other problems. I'll post again shortly.

    CSDunn

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

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