Is there a faster way to do the insert below. The text file
in question is
15mb and the code below takes approximately 5 minutes to
execute.
Bare in mind the following conditions;
1) I am in a hosted web environment using MX7 and a MS Sql
database that
reside on different boxes. Therefore I cannot simply use a
DTS
wizzard/package to import the file.
2) I cannot get Bulk Insert permisions granted on my SQL
hosting.
3)The text file is downloaded daily and FTP'd over to a
folder on my web
server. I do not have a local MS SQL dataabse running 24/7 to
run a DTS
package locally to complete the task.
4) Im hoping to automate the task at least 3 times a day by
scheduling in
coldfusion
<cfsetting requesttimeout="420">
<cfhttp method="get" textqualifier=" "
firstrowasheaders="no" delimiter="|"
username="xxxxxx" password="xxxxxxxxx" name="test"
url="
http://208.106.197.112/prms/ordhist1xx.txt">
<cfloop query="test">
<cfquery datasource="development" username="xxxxxxxx"
passWord="xxxxxxxxx">
INSERT INTO order_history
(OrderNo, Line, seq, AccountNo, Shipment, Invoice,
PurchaseOrder, Completed,
OrderDate, ShipmentDate, Backorder, Product, QtyOrdered,
QtyShipped,
QtyInvoiced, Price, Carrier, Connote, Delivery1, Delivery2,
Delivery3,
Delivery4, Delivery5, Delivery6, Delivery7, expected)
VALUES
('#test.column_1#', '#test.column_2#', '#test.column_3#',
'#test.column_4#',
'#test.column_5#', '#test.column_6#', '#test.column_7#',
'#test.column_8#',
'#test.column_9#', '#test.column_10#', '#test.column_11#',
'#test.column_12#', '#test.column_13#', '#test.column_14#',
'#test.column_15#', '#test.column_16#', '#test.column_17#',
'#test.column_18#', '#test.column_19#', '#test.column_20#',
'#test.column_21#', '#test.column_22#', '#test.column_23#',
'#test.column_24#', '#test.column_25#', '#test.column_26#')
</cfquery>
</cfloop>