bit in database, true/false being output to .csv

  • I would like to output a bit into a .CSV file but the 0 and 1's keep ending up as true or false. I have tried:

    convert(integer,column) as column

    I thought if I changed the data type on the fly this would work, however it is still comming out as true or false.

    I want to end up with 0 and 1's in the flat file instead of true and false

    Thanks,

    maui

  • Did you try a case statement?


    Cheers,

    Ben Sullins
    bensullins.com
    Beer is my primary key...

  • yip i've tried a case statement, it did feel a little silly because I was trying to set something to 0 or 1 when it was already that. SSIS knows that it is a bit and a bit is boolean so it trys to be clever and name it appropriately, I just want SSIS to do what its told! Does anyone have any other suggestions? 🙂

  • How about creating a temp table to store the info that you want to export to the .csv file? In the temp table you make the column type of the boolean field integer. After you have inserted all the values into the temp table export the temp table to .csv.

    Hope it helps.

  • I could do, but I would prefer not to have to create yet another table. SSIS is supposed to be this flashy ETL tool, surely it must be able to handle it

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

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