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 insertion of data in sql server

Bulk insertion of data in sql server

Scheduled Pinned Locked Moved Database
helpdatabasecsharpsql-server
2 Posts 2 Posters 2 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.
  • M Offline
    M Offline
    montu3377
    wrote on last edited by
    #1

    Hi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database (sql server 2005). Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database using sql server 2005? thanks montu3377

    S 1 Reply Last reply
    0
    • M montu3377

      Hi, There is a requirement to insert data into Bulk like 20,000 - 30,000 rows into database (sql server 2005). Description: I have to get one number from text file,bifercate that number and from 1st 5 digit i have to find out ID from sql server 2005 table and then go for second number of that number ,find out ID from sql server 2005 table,this process happens for 4 times for that one number and i have to do same process for 20000 rows. Once i get all those IDs into variables into vb.net from sql server 2005,i have to insert those into one physical table and than one package will run that insert those records into another table. Here main problem i am feeling is speed issue,to process 20000 rows for getting ids and inserting back into sql server takes somuch time. So can some body help me out which way to go to insert records into database using sql server 2005? thanks montu3377

      S Offline
      S Offline
      sampathkumarg
      wrote on last edited by
      #2

      You can Bulk insert (using BCP or managed SqlBulkCopy) the text file contents to a table and use a stored proc to do read from that table and insert/update into the target table.

      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