Created
April 25, 2010 20:06
-
-
Save joshknutson/378677 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfsetting requesttimeout="9999999" /> | |
<cfsetting showdebugoutput="false" /> | |
<cfoutput> | |
starting<br /> | |
<cfset theFile = "c:\someVeryVeryLargeFile.sql" /> | |
<cfset from= 1 /> | |
<cfset to = 300500 /> | |
from #from#<br /> | |
to #to#<br /> | |
<cfset tick = GetTickCount()> | |
<cfset counter = from /> | |
<!--- from="#from#" to="#to#" ---> | |
<cfloop file="#theFile#" index="line" charset="UTF-16"> | |
<cfif line contains "insert"> | |
<!---#line#<br />---> | |
<cflog file="db_copy" application="no" text="LINE: #counter# started" /> | |
<cftry> | |
<cfquery name="try" datasource="#application.dsn#"> | |
#preservesinglequotes(line)# | |
</cfquery> | |
<cfcatch type="database"> | |
<!---do nothing---> | |
</cfcatch> | |
</cftry> | |
<cflog file="db_copy" application="no" text="LINE: #counter# finished" /> | |
</cfif> | |
<cfset counter++ /> | |
</cfloop> | |
done<br /> | |
<cfset tock = GetTickCount()> | |
<cfset time = tock-tick> | |
it took #time#ms | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment