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