How to validate a CSV import file?

  • Hi!

    Is there some usable solution on how to validate an import file? (like the right Delimiter and the correct number of rows and the format of fields)

    I dont really know how to write this in VB so I am a bit stuck...

    /gΓΌ

  • Yes... Bulk Insert with output to an error file and successful inputs to a well defined table. I don't use SSIS but I believe there's a Bulk Insert task available in SSIS. The reason I don't use SSIS is because I do it all in T-SQL. The information is in Books Online under Bulk Insert and is a bit too detailed to copy and paste into a forum.

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

  • Jeff Moden (12/29/2008)


    I don't use SSIS but I believe there's a Bulk Insert task available in SSIS. The reason I don't use SSIS is because I do it all in T-SQL

    I also usually do all in t-sql than depends on tools πŸ™‚

    I think developers also want it

    The popularity of this thread is an example

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926


    Madhivanan

    Failing to plan is Planning to fail

  • Good thread. I like the sp_MakeWebTask trick.

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

  • Jeff Moden (12/30/2008)


    Good thread. I like the sp_MakeWebTask trick.

    Thanks Jeff Moden πŸ™‚


    Madhivanan

    Failing to plan is Planning to fail

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

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