Data export from SQL DB to csv file using SSIS package

  • Hi,

    I have created a SSIS package, that will export the SQL Server 2005 database tables(50+) data to indidual csv files.

    For some tables column data is 1/0 in actual SQL table, when I converted into csv files column data is TRUE/FALSE. I need 1/0 in destination(csv)

    HERE IS ONE TABLE FOR EXAMPLE:

    select KetonesID, KetonesName, KetonesVisible

    from Ketones

    Coulumn Name: KetonesVisible

    DATA TYPE: (bit, notnull)

    Please advice.

  • One option is to use the derived column transform along with the conditional split in the dataflow to convert the data you have to the values you want.

    Another option is to use a query to pull the data and use the CASE statement in the query to do the conversion.



    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]

  • Another option is to use to data conversion component to convert the boolean values (which are by nature true or false) to integer. This should return your 0 or 1 values.

    @Alvin: I just noticed your signature 😀 Priceless (no pun intended)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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