Export a Stored's result in multilple CSV

  • Hi everyone I need your precious help! I'm a newbie on SSIS 🙂

    I'm working on SSIS 2008.

    I have a parametric stored that results a multiple recordset.

    Now i want to know how can I suddivide my recordset in N files csv, any file should be contains values for his Category:

    Example:

    Recordset

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat2

    C1 C2 C3 C4 C5 Cat2

    CSV1:

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    CSV2:

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat2

    C1 C2 C3 C4 C5 Cat2

  • gladiatore85 (2/17/2011)


    Hi everyone I need your precious help! I'm a newbie on SSIS 🙂

    I'm working on SSIS 2008.

    I have a parametric stored that results a multiple recordset.

    Now i want to know how can I suddivide my recordset in N files csv, any file should be contains values for his Category:

    Example:

    Recordset

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat2

    C1 C2 C3 C4 C5 Cat2

    CSV1:

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat1

    CSV2:

    C1 C2 C3 C4 C5 Cat1

    C1 C2 C3 C4 C5 Cat2

    C1 C2 C3 C4 C5 Cat2

    Yes, as long as you know all the categories you might encounter.

    Add a condition split in you dataflow that checks what the category is and use this a as a swtch to direct the data for each category to it's respective output.



    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]

  • Thanks Alvin, but i cannot use the SPLIT 'cause the Categories are undefined...

    Anyway i've found solution using a temp recordset, i select every distinct categories, then i loop a dataflow on that values.

    Bye!

  • gladiatore85 (2/21/2011)


    Thanks Alvin, but i cannot use the SPLIT 'cause the Categories are undefined...

    Anyway i've found solution using a temp recordset, i select every distinct categories, then i loop a dataflow on that values.

    Bye!

    You're welcome.

    Glad you found a solution that works for you.



    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