Exporting csv files to database

  • Hi,

    I have ssis package that exports data from csv file . it works fine for the data of the following format

    name age address

    abd 24 eweetgb

    i have a another file of the following format

    name,age,address

    abg,66,huhuuu

    in order to make this this kind of format to work what am i suppose to do?

  • From what you've posted, I'd say just change the delimiter.

    --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)

  • it works when i change the delimeter but i want to do it dynamically.. any suggestions

  • Actually, I'm pretty much out of line here... I do everything from T-SQL... I've never written a DTS package and will probably never write an SSIS "package". My appologies...

    ... I hope someone else picks up on this and makes a more decent suggestion than I.

    --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)

  • There are some possibility's of making this a bit more dynamic. By using configuration files and using variables.

    But the SSIS package loads as far as i get several documents with another delimiter. The packages runs every day?? Does it run the same documents every day? So if you might send me some more information about your problem.

  • I have a process like this that works great. I have to load files in from a client and they send the damn files as csv and tab delimited. Field names are the same but the delimitter needs to change to accomodate the file being loaded. What I do is have a connection for the csv file and the tab file. When it tries to load the csv file and its tab delimitted it will of course fail. So on this fail it goes and loads it as tab delimitted.

    Strick

  • looks like stricknyn has the right idea. depending on how often one format shows up vs. the other, his approach may be about the fastest... saves the step of having to read the file just to check what the format is.

Viewing 7 posts - 1 through 6 (of 6 total)

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