Output to multiple text file based on query

  • Hello,

    Can anybody please tell me how to have an output on multiple file from a single query based on the result.

    For example,

    If I have a query:

    SELECT Name, Address FROM Customer WHERE Name='JOHN' OR Name='BEN'

    Now, I want to output the results for two customers in their specific file i.e. JOHN_FILE and BEN_FILE.

    Please let me know, what transformation would I have to use?

  • hasan.askari (9/24/2010)


    Hello,

    Can anybody please tell me how to have an output on multiple file from a single query based on the result.

    For example,

    If I have a query:

    SELECT Name, Address FROM Customer WHERE Name='JOHN' OR Name='BEN'

    Now, I want to output the results for two customers in their specific file i.e. JOHN_FILE and BEN_FILE.

    Please let me know, what transformation would I have to use?

    Use a DataFlow with a Condition Split that checks for Name = John or Name = Ben. Direct one output from the Condition Split to the John file and the other to the Ben file.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Alvin Ramard (9/24/2010)


    hasan.askari (9/24/2010)


    Hello,

    Can anybody please tell me how to have an output on multiple file from a single query based on the result.

    For example,

    If I have a query:

    SELECT Name, Address FROM Customer WHERE Name='JOHN' OR Name='BEN'

    Now, I want to output the results for two customers in their specific file i.e. JOHN_FILE and BEN_FILE.

    Please let me know, what transformation would I have to use?

    Use a DataFlow with a Condition Split that checks for Name = John or Name = Ben. Direct one output from the Condition Split to the John file and the other to the Ben file.

    Thanks Alvin. That helped.

  • You're welcome.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

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

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