473,473 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Xml Bulk Load in SQL 2000 relationship error

26 New Member
Hi All,

I'm using SQL 2000 and in a DTS I want to load in an error XML file to a SQL table.

I am using the SQLXMLBulkLoad component in an Active X script.

I have an XML file. see below, and also an XSD schema file. Could someone take a look and see where I am going wrong??!

I get an error from SQL stating "Relationship expected on errors"

I need simply the contents of each error_msg tag to populate a field called errormsg in a table called Error_Response table

## START SCHEMA
[HTML]<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:dt="urn:schemas-microsoft-com:xml:datatypes" targetNamespace="mytargetnamespace.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xs:element name="stockorder_error" >
<xs:complexType>
<xs:sequence>
<xs:element name="errors" >
<xs:complexType>
<xs:sequence>
<xs:element name="error" sql:relation="Error_Response">
<xs:complexType>
<xs:sequence>
<xs:element name="error_message" sql:field="errormsg" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>[/HTML]
## END SCHEMA

## START XML FILE
[HTML]
<?xml version="1.0" ?>
<stockorder_error xmlns="mytargetnamespace.com" version="1a" >
<errors>
<error>
<error_message>This is an error</error_message>
</error>
</errors>
</stockorder_error>[/HTML]
## END XML FILE

Thanks

mh
Jun 26 '08 #1
1 1712
mharrison
26 New Member
Found the issue

I changed from an XSD to XDR schema

and used the following:

[HTML]<?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"
sql:target-namespace="mytargetnamespace">


<ElementType name="stockorder_error" dt:type="string" sql:is-constant="1">
<AttributeType name="xmlns" required="no" dt:type="string"/>
<AttributeType name="version" required="no" dt:type="string"/>
</ElementType>

<ElementType name="error_message" dt:type="string" />

<ElementType name="error" sql:relation="Error_Response">
<element type="error_message" sql:field="errormsg" />

</ElementType>

</Schema>[/HTML]

behind the times for schemas I know, but least i got it working!
Jun 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Sharp | last post by:
I've been doing some experiments with speeding up copying tables of approximately 1 million rows between databases using BCP and BULK INSERT. I noticed that the total time for removing the...
2
by: tperovic | last post by:
Using SS2K, I'm getting the following error while bulk inserting: Column 'warranty_expiration_date' cannot be modified because it is a computed column. Here is my bulk insert statement: ...
7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
6
by: pk | last post by:
Sorry for the piece-by-piece nature of this post, I moved it from a dormant group to this one and it was 3 separate posts in the other group. Anyway... I'm trying to bulk insert a text file of...
11
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
3
by: Tim Satterwhite | last post by:
Hi All, I think this is a thorny problem, and I'm hoping you can help. I've not found this exact issue described anywhere yet. I have a stored procedure that calls BULK INSERT on a set of...
0
by: deepakgeorge | last post by:
We are trying to migrate databases and DTS from SQL Server 2000 to 2005. A BULK insert with in a DTS is failing showing the error. Bulk load data conversion error (type mismatch or invalid...
2
by: nano | last post by:
Does sql server have a way to handle errors in a sproc which would allow one to insert rows, ignoring rows which would create a duplicate key violation? I know if one loops one can handle the error...
0
by: NickW | last post by:
I have written a stored procedure that is used to load data into a SQL Server 2000 and 2005 databases from some 40ish different text files. One of the text files is loading all of the rows apart from...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.