Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

SQLXMLBULKLOAD mapping file Expand / Collapse
Posted Tuesday, June 25, 2013 11:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 24, 2013 10:59 AM
Points: 6, Visits: 17

I tried SQLXMLBulkLoad option by creating the mapping file and VB script, its not giving any error when I run the VB script and not loading the data into temp table.Here is my mapping file and VB script. How to map the attribute value job id into sql field along with cycle_no and pdm elements
and How to map the hard coded table name to sql:relation valueÉ

Customers.xml :

<?xml version="1.0" ?>
<job id="100360003">
<cycle_no type="string">36</cycle_no>
<PDM type="string">C</PDM>
<job id="100360004">
<cycle_no type="string">36</cycle_no>
<PDM type="string">C</PDM>

Customermapping.xml :

<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >

<AttributeType name="Id" />
<ElementType name="Cycle_no" dt:type="string" />
<ElementType name="PDM" dt:type="string" />

<ElementType name="batch" sql:is-constant="1">

<ElementType name="job" sql:relation="temp_xml">
<attribute type="Id" sql:field="Id" />
<element type="Cycle_no" sql:field="Cycle_no" />
<element type="PDM" sql:field="PDM" />



Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=XXXXXXXX;data source=XXXXXXXX;database=XXXXXX;uid=XXXXXX;pwd=XXXXX"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\customermapping.xml", "c:\customers.xml"
Set objBL = Nothing

Post #1467297
Posted Tuesday, June 25, 2013 11:22 AM



Group: General Forum Members
Last Login: Yesterday @ 5:19 PM
Points: 14,549, Visits: 38,413
duplicate post.
There's no need to post the same question in multiple forums.
The Recent Posts>>Posts Added Today function which most people use shows us your post immediately.
crossposting will wastes people's time and fragments replies.

No replies to this thread please. Direct replies to


help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1467299
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse