How to only export to text where data exist

  • I would recommend getting the row count from your table and populating a variable with it. Use that variable inside a precedence constraint. Use an expression to test for a non zero value in an expression on the precedence constraint.

    If you've used a Data Flow to populate your table, simply use the Row Count transformation just before your destination adapter to get the row count into a variable. If you've not used a Data Flow, you'll need to call another ExecuteSQL task and return the results into a variable from there. Either way, it's pretty straight forward.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I hadn't known about expressions in constraints until now. It is straightforward, isn't it?

    Thanks

    --
    Scott

  • Yes. In your Control Flow, just double-click on the connector and it will bring up the Precedence Constraint Editor. For the Evaluation Operation, you'll want to use Expression and Constraint. Set the Value option to Success and build your Expression in the Expression box.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

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

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