Results 1 to 3 of 3

Thread: Using BCP to Import

  1. #1
    Join Date
    Nov 2002
    Posts
    13

    Using BCP to Import

    Hi

    I'm using the BCP facility to import a text file into a database. My problem is, in the table there are 10 fields but my file only contains data for 3 fields

    e.g
    Table - id,forname,surname,dob,gender,mob_number
    File - forname,surname,mob_number

    is there a way of only importing into the required fields or do i have to have columns in the order they are in, in the table????

    can I use this file??
    matt,jones,0775446644
    chris,jones,066565465

    or do i have to use this???
    ,matt,jones,,,0775446644
    ,chris,jones,,,066565465
    Edit/Delete Message

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Other columns accept null value?

  3. #3
    Join Date
    Dec 2004
    Posts
    502
    If you use a bcp format file, you could then choose which columns to ignore. Otherwise, you'd have to use your second method (matching the column positions with the data).

Posting Permissions

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