Execute next step based on Stored Procedure output

  • SQL 2000.....

    I'm trying to conditionally execute an "Execute SQL Task" step from the previous "Execute SQL Task" based on the output of the proc in the first step.

    The first step fires a proc that kicks out an Output Param. I've set this output param to a Global Variable (not sure if I'm on the right track). If the output parameter is a paticular value I want to execute the next step.

    I thought using a global variable might be the right way to tackle this but I don't see anywhere in the Workflow properties that I can sepicify something like this. Any ideas? TIA.

  • Dear AVB,

    Based on the first sql task value, you can enable and disable the next task, to do that use a activex script task in between and write VBA code to disable\enable next task.

    Reg

    RB

  • I 'd suggest you to try two approaches:

    1.- As someone else states, use a VBScript task to write the conditional code. In this case, you can set two green work-flow arrows for that task, and set the NextStep.Disable = False for the one you want to seek (and True for the other).

    2.- Not so elegant, but you can also raise an error based on the output parameter of the former SP, and set two work-flow arrows, one for the task error case (the red one), and the other (green) for the ok case.

    Diego Buendia

    Barcelona, Spain

  • This might help: http://www.sqldts.com/218.aspx

    Multiple execution paths shown, using scripting as suggested above.

  • Rock on!

    Thanks for the replies and the link. SSC to the rescue (again)!

  • If you come up with something interesting, consider dropping an article here. Still some people using DTS.

Viewing 6 posts - 1 through 5 (of 5 total)

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