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. General Programming
  3. C#
  4. Update database without SQL???

Update database without SQL???

Scheduled Pinned Locked Moved C#
databasequestioncsharpannouncement
2 Posts 2 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.
  • J Offline
    J Offline
    jstonge
    wrote on last edited by
    #1

    First of all, I'm not an expert on data access. But in my trials and tribulations with ADO.Net and ADO I've yet to find a way to update a database without it using SQL to do its work. It seems to me that if I have a large recordset that I create which I want to add to a database, it should be doable without the overhead of converting to SQL and then having the DBMS unconvert it on its side. Is this possible with ADO.Net, and if so, how? Let's say that I have a simple table in the database with 200 double-precision floating point fields. If at some point, I have 4,000 rows to add to the table (6,400,000 bytes of data) how can I add this data to the database as efficiently as possible? It seems to me that converting everything to a text command in SQL when I already have the data formatted as a 4000x200 table is inefficient.

    D 1 Reply Last reply
    0
    • J jstonge

      First of all, I'm not an expert on data access. But in my trials and tribulations with ADO.Net and ADO I've yet to find a way to update a database without it using SQL to do its work. It seems to me that if I have a large recordset that I create which I want to add to a database, it should be doable without the overhead of converting to SQL and then having the DBMS unconvert it on its side. Is this possible with ADO.Net, and if so, how? Let's say that I have a simple table in the database with 200 double-precision floating point fields. If at some point, I have 4,000 rows to add to the table (6,400,000 bytes of data) how can I add this data to the database as efficiently as possible? It seems to me that converting everything to a text command in SQL when I already have the data formatted as a 4000x200 table is inefficient.

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      Convert everything to a text file and use the BCP (bulk copy) utility. This is the fastest way to upload to a SQL Server database (in reasonable servers, I got about 100,000 rows/second). The second fastest way, much slower, but much more flexible is using DTS. Concussus surgo. When struck I rise.

      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