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. Fast Insert ?

Fast Insert ?

Scheduled Pinned Locked Moved Database
c++databasedata-structureshelptutorial
4 Posts 4 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.
  • S Offline
    S Offline
    ssirisha
    wrote on last edited by
    #1

    ACCESS2000, ADO with VC++ I need to insert 500 records into a table. I am executing the following query for each record in a loop.. ///////////// PARAMETERS vID Short, vMRad IEEESingle, vQual Byte, vType Byte, vCRad IEEESingle, vWID Long; INSERT INTO PostODData ( OID, MRad, Qual, Type, CRad, WID ) VALUES (vID, vMRad, vQual, vType, vCRad, vWID); ////////////////// This insertion takes about 5 secs on a 400Mhz computer and I need to cut the time down to 1 sec or smaller. Any suggestions how to improve. Is it possible to send the parameters for all 500 records in an array . Does it help ? Thanks

    D P 2 Replies Last reply
    0
    • S ssirisha

      ACCESS2000, ADO with VC++ I need to insert 500 records into a table. I am executing the following query for each record in a loop.. ///////////// PARAMETERS vID Short, vMRad IEEESingle, vQual Byte, vType Byte, vCRad IEEESingle, vWID Long; INSERT INTO PostODData ( OID, MRad, Qual, Type, CRad, WID ) VALUES (vID, vMRad, vQual, vType, vCRad, vWID); ////////////////// This insertion takes about 5 secs on a 400Mhz computer and I need to cut the time down to 1 sec or smaller. Any suggestions how to improve. Is it possible to send the parameters for all 500 records in an array . Does it help ? Thanks

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

      ssirisha wrote: This insertion takes about 5 secs on a 400Mhz computer and I need to cut the time down to 1 sec or smaller. Use SQL Server and BCP utility. Sorry, I don't know other way... My latest articles: Desktop Bob - Instant CP notifications XOR tricks for RAID data protection

      M 1 Reply Last reply
      0
      • S ssirisha

        ACCESS2000, ADO with VC++ I need to insert 500 records into a table. I am executing the following query for each record in a loop.. ///////////// PARAMETERS vID Short, vMRad IEEESingle, vQual Byte, vType Byte, vCRad IEEESingle, vWID Long; INSERT INTO PostODData ( OID, MRad, Qual, Type, CRad, WID ) VALUES (vID, vMRad, vQual, vType, vCRad, vWID); ////////////////// This insertion takes about 5 secs on a 400Mhz computer and I need to cut the time down to 1 sec or smaller. Any suggestions how to improve. Is it possible to send the parameters for all 500 records in an array . Does it help ? Thanks

        P Offline
        P Offline
        Pavel Klocek
        wrote on last edited by
        #3

        I don't know about ADO but in DAO it was significantly faster to use a recordset's AddNew/Update methods to insert records than INSERT statement. Pavel Sonork 100.15206

        1 Reply Last reply
        0
        • D Daniel Turini

          ssirisha wrote: This insertion takes about 5 secs on a 400Mhz computer and I need to cut the time down to 1 sec or smaller. Use SQL Server and BCP utility. Sorry, I don't know other way... My latest articles: Desktop Bob - Instant CP notifications XOR tricks for RAID data protection

          M Offline
          M Offline
          Morten Abrahamsen
          wrote on last edited by
          #4

          You could use the XML version IXmlBulkLoad (?) found in one of the SqlXml releases for SQL Server 2000. It would give you a more "programmable" approach. You could also use the native OLEDB interface (used by BCP ? ) IRowsetFastLoad. (look it up in the SQLOLEDB specs.) Morty

          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