SSIS-importing data from CSV file to database

  • i am importing data from csv file to database. but csv files are of different formats like some file contains data of format

    ---->abc,bbb,ggg

    ---->"123" "fff" "fgg"

    ---->shgvgf kjgh lkjhg

    in order to import these formats what i suppose to do? please reply

  • Step 1... take the data provider out to dinner... feed the data provider a nice juicy pork chop... with a slingshot!

    Seriously... my first step would be to get the data provider to clean up their act! If it's "one time" data, I'd still ask them to clean it up.

    Now, if you boss is standing on your lower lip and pulling up hard on your nostrils to get this done, you'll need to import the file into a single wide column and conditionally make three passes at the data to be able to handle the 3 different delimiters.

    Another way would be to make 3 different BCP Format files and allow a bazillion errors... again, 3 passes at the data...

    I'm still thinking the pork chop is a really good idea 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Can you explain in detail please..

  • checkthis

    http://204.9.76.233/articles/dba/import_text_files_ssis_p1.aspx




    My Blog: http://dineshasanka.spaces.live.com/

  • pavithag_clarion (12/28/2007)


    Can you explain in detail please..

    Dinesh's fine solution will work for SSIS... I just don't like SSIS 😛

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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