Question
how to speed insert my 1000000 records into the database?
my code like:
<cfloop from="1" to="#inserteddb.getrecordcount()#" index="x">
<!----
Here make the InsertFieldList and InsertValueList
--->
<cfquery datasource="#cfdsn#" name="insertdata">
insert into inputtest (#InsertFieldList#)
values (
<cfqueryparam value="#InsertValueList#" cfsqltype="cf_sql_varchar" list="yes">
)
</cfquery>
</cfloop>
The test inserts 100,000 records, has spend I 30 minutes time,but I have 1,000,000 record to insert , is there any way to enhance the insertion speed?
Thanks a lot.
<cfloop from="1" to="#inserteddb.getrecordcount()#" index="x">
<!----
Here make the InsertFieldList and InsertValueList
--->
<cfquery datasource="#cfdsn#" name="insertdata">
insert into inputtest (#InsertFieldList#)
values (
<cfqueryparam value="#InsertValueList#" cfsqltype="cf_sql_varchar" list="yes">
)
</cfquery>
</cfloop>
The test inserts 100,000 records, has spend I 30 minutes time,but I have 1,000,000 record to insert , is there any way to enhance the insertion speed?
Thanks a lot.