Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Bulk insert - Fewer fields than in DB

Bulk insert - Fewer fields than in DB

Scheduled Pinned Locked Moved Database
database
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    clint1982
    wrote on last edited by
    #1

    Hi I want to use bulk insert in order to insert information from a CSV to the database. The CSV contains fewer fields than the DB. I don't want to use a format file, I want to specify all the options within the with clause. I need to map the fields in the CSV to the fields within the Database table. Thanks, Clint

    P G 2 Replies Last reply
    0
    • C clint1982

      Hi I want to use bulk insert in order to insert information from a CSV to the database. The CSV contains fewer fields than the DB. I don't want to use a format file, I want to specify all the options within the with clause. I need to map the fields in the CSV to the fields within the Database table. Thanks, Clint

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      I can't help with that; I use bcp with a format file to load a table defined specifically to accept the bulk-loaded data, then I move the data to the target tables(s).

      1 Reply Last reply
      0
      • C clint1982

        Hi I want to use bulk insert in order to insert information from a CSV to the database. The CSV contains fewer fields than the DB. I don't want to use a format file, I want to specify all the options within the with clause. I need to map the fields in the CSV to the fields within the Database table. Thanks, Clint

        G Offline
        G Offline
        GuyThiebaut
        wrote on last edited by
        #3

        I can't help with a bulk insert - however would doing an import via Enterprise Manager be an option? I mention this because you can map fields through the import wizard and it should cover what you want to do. Of course this is a once off option for ad-hoc jobs, but if doing a bulk insert is not absolutely necessary and this is an ad-hoc job I'd suggest looking at this option. In Enterprise Manager it is under Tools/Data Transformation Services/Import Data... You an also get to this via the SQL Server tab on your start menu under Import and Export Data Hope this helps...

        You always pass failure on the way to success.
        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups