Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Question Unanswered: Importing data & inserting value

    I've got a bunch of CSV files (21) which all contain the same fields but are only distinguishable from their file names. I.e. file.001 file.002 etc. I need to collaborate them all into one table on our Datawarehouse. I’m currently doing the following:

    1. Drop & recreate a temp table with an additional column as a default value based on the corresponding file extension (manually entered into the DTS routine).
    2. Import a single file into a temp table.
    3. Transfer the temp table data to the permanent table with “Keep Null Values” ticked.

    I’ve only got as far as importing 2 of the files (which works!) but is getting messy already with 10 steps so far!

    There must be an easy way as a file is being imported to add a value on each row rather then going through all these processes!

    Can anyone help?

    Thanks in advance!

  2. #2
    Join Date
    Dec 2002
    Antwerp, Belgium
    You can use the bcp import utility with a format file. See in BOL for more info on format files.

Posting Permissions

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