I would like to do a bulk insert into SQL Server 2000 from an XML file. I've
been googling, trying a few things but don't seem to be able to get it to work.
My format file ("getEventPerformersMapping.xml") looks like this:
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="EventID" dt:type="i8" />
<ElementType name="PerformerID" dt:type="int" />
<ElementType name="PerformerName" dt:type="string" />
<ElementType name="ROOT" sql:is-constant="1">
<element type="EventPerformer" />
</ElementType>
<ElementType name="EventPerformer" sql:relation="EventPerformer">
<element type="EventID" sql:field="EventID" />
<element type="PerformerID" sql:field="PerformerID" />
<element type="PerformerName" sql:field="PerformerName" />
</ElementType>
</Schema>
My XML file ("getEventPerformers.txt") looks like this:
<ROOT>
<EventPerformer>
<EventID>448410</EventID>
<PerformerID>3160</PerformerID>
<PerformerName>Lion King</PerformerName>
</EventPerformer>
<EventPerformer>
<EventID>448412</EventID>
<PerformerID>3160</PerformerID>
<PerformerName>Lion King</PerformerName>
</EventPerformer>
</ROOT>
My Query looks like this:
<cfquery datasource="db_events" name="doInserts">
BULK INSERT tbl_EventPerformers
FROM 'D:\Websites\globalFunctions\getEventPerformers.txt' WITH
(FORMATFILE='D:\Websites\globalFunctions\getEventPerformersMapping.xml')
</cfquery>
The error I'm getting is this:
[Macromedia][SQLServer JDBC Driver][SQLServer]Could not bulk insert. Unknown
version of format file
'D:\Websites\globalFunctions\getEventPerformersMapping.xml'.
Any help would be appreciated. I'd love to be able to use bulk insert instead
of a one hundred thousand count loop with inserts.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317027
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4