Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    Unanswered: Flat file import

    I am trying to import a flat file with large rows into MS SQL Server. This flat file consists of about 100 columns of data, followed by a set of 10 columns repeated 50 times.

    I would like very much to break the data apart in the import. What's the best way to handle it?

    Dyolf Knip

  2. #2
    Join Date
    Feb 2004
    Either split up the file in two before the import, or, create an import table that consists of 100 columns, do the import, and work your way through the data finding out when the 10 column part starts. If you can select it, you can deal with it. It might work better or easier with a temp table with only one very wide column and do the processing after that.

    Possibly there's a way to have one file and two fmt files that bcp uses to work on, inserting rows into two different tables. I'm not sure how to deal with the error's though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts