Showing posts with label bulkload. Show all posts
Showing posts with label bulkload. Show all posts

Friday, February 10, 2012

Bulkload XML to SQL2005

I have hundreds of large (500meg) XML files I need to upload into SQL2005. I followed the example from http://support.microsoft.com/default.aspx/kb/316005/en-us with no major problems. Unfortunatly my data can be several fields deep within the xml file (sample below).

I'm created a vbs file to process the bulkload.

I'm not able to figure out how to create the mapping (schema) for this file structure. I'm trying to use a mapping schema simular to what is used in the example.

How do I modify the mapping schema for my format?

Please help educate me. I am a noob, so please keep it simple.

Thanks

Charles W

XML File

<ROOT>
<Customers>
<CustomerId><IDno><pdat>2111</pdat></IDno></CustomerId>
<CompanyName><pdat>2Sean Chai</pdat></CompanyName>
<City><pdat>NY</pdat></City>
</Customers>
<Customers>
<CustomerId><IDno><pdat>2112</pdat></IDno></CustomerId>
<CompanyName><pdat>2Tom Johnston</pdat></CompanyName>
<City><pdat>LA</pdat></City>
</Customers>
<Customers>
<CustomerId><IDno><pdat>2113</pdat></IDno></CustomerId>
<CompanyName><pdat>2Institute of Art 3</pdat></CompanyName>
</Customers>
</ROOT>

XSD File

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<xs:element name="ROOT" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Customers"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Customers" sql:relation="Customer">
<xs:complexType>
<xs:sequence>
<xs:element ref="CustomerId" sql:field="CustomerId" />
<xs:element ref="CompanyName" sql:field="CompanyName" />
<xs:element minOccurs="0" ref="City" sql:field="City"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CustomerId" type="xs:integer"/>
<xs:element name="CompanyName" type="xs:string"/>
<xs:element name="City" type="xs:NCName"/>
</xs:schema>

VBS

Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=12T4581-CHUCK;database=MyDatabase;uid=XMLtest;pwd=XMLtest"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\customer3.xsd", "c:\customers3.xml"
Set objBL = Nothing

FYI:

To solve my problem, I created a .net application to modify my xml file into a format that I can work with. It really turned out to be the best solution for me because I have to make some other modifications.

I can take a 600k xml file and stip out the data I need in under 1 minute. At this rate I can prep an entire years worth of data in under 15 minutes.

Now I need to master XSD files.....

Charles W

|||

This is the recommended way to achieve your mapping. Bulkload would not support your shape of having multiple layers of wrappers around your scalar type. So Bulkload would support:

<City>NY</City>

But not:

<City><pdat>NY</pdat></City>

Bulkload XML to SQL2005

I have hundreds of large (500meg) XML files I need to upload into SQL2005. I followed the example from http://support.microsoft.com/default.aspx/kb/316005/en-us with no major problems. Unfortunatly my data can be several fields deep within the xml file (sample below).

I'm created a vbs file to process the bulkload.

I'm not able to figure out how to create the mapping (schema) for this file structure. I'm trying to use a mapping schema simular to what is used in the example.

How do I modify the mapping schema for my format?

Please help educate me. I am a noob, so please keep it simple.

Thanks

Charles W

XML File

<ROOT>
<Customers>
<CustomerId><IDno><pdat>2111</pdat></IDno></CustomerId>
<CompanyName><pdat>2Sean Chai</pdat></CompanyName>
<City><pdat>NY</pdat></City>
</Customers>
<Customers>
<CustomerId><IDno><pdat>2112</pdat></IDno></CustomerId>
<CompanyName><pdat>2Tom Johnston</pdat></CompanyName>
<City><pdat>LA</pdat></City>
</Customers>
<Customers>
<CustomerId><IDno><pdat>2113</pdat></IDno></CustomerId>
<CompanyName><pdat>2Institute of Art 3</pdat></CompanyName>
</Customers>
</ROOT>

XSD File

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<xs:element name="ROOT" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Customers"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Customers" sql:relation="Customer">
<xs:complexType>
<xs:sequence>
<xs:element ref="CustomerId" sql:field="CustomerId" />
<xs:element ref="CompanyName" sql:field="CompanyName" />
<xs:element minOccurs="0" ref="City" sql:field="City"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CustomerId" type="xs:integer"/>
<xs:element name="CompanyName" type="xs:string"/>
<xs:element name="City" type="xs:NCName"/>
</xs:schema>

VBS

Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=12T4581-CHUCK;database=MyDatabase;uid=XMLtest;pwd=XMLtest"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "c:\customer3.xsd", "c:\customers3.xml"
Set objBL = Nothing

FYI:

To solve my problem, I created a .net application to modify my xml file into a format that I can work with. It really turned out to be the best solution for me because I have to make some other modifications.

I can take a 600k xml file and stip out the data I need in under 1 minute. At this rate I can prep an entire years worth of data in under 15 minutes.

Now I need to master XSD files.....

Charles W

|||

This is the recommended way to achieve your mapping. Bulkload would not support your shape of having multiple layers of wrappers around your scalar type. So Bulkload would support:

<City>NY</City>

But not:

<City><pdat>NY</pdat></City>

bulkload xml file with declared external dtd file

I have a several xml files to import in a sql 2005 xml datatype column with the OPENROWSET BULKLOAD.
The xml files declares an external dtd.
I must use the CONVERT option 2 to avoid an internal dtd error.
When I try to read the column, sql throws a Lists of BinaryXml value tokens not supported error because xml use special entity characters was declared in dtd.
Is there a solution for resolve using the dtd like a schema?

Paolo

Paolo,

Regarding DTD processing for imposing constraints as XSD does, no, there is no option in SQL Server 2005 to cause this validation. The extent of our DTD processing is to verify that internal subsets are syntactically correct, perform entity expansion, and apply attribute default values. We do not perform validation of the xml document per the DTD constraints.

For the error you are receiving, I am unable to reproduce this with a simple test. Please let me know if the following example works for you. If so, perhaps you can elaborate on what is different with what you are attempting.

(1)Create file on disk (c:\temp\dtd1.xml) with contents like:

<!DOCTYPE DOC SYSTEM "C:\MyExternalDTD.xml" [<!ATTLIST elem1 attr1 CDATA "defVal1">]><elem1><childelem1/></elem1>

(2)Execute following tsql to load and query out the document:

CREATE TABLE t1 (xmlCol XML)

go

INSERT t1

SELECT

CONVERT(XML, BulkColumn, 2)

FROM

OPENROWSET (BULK 'c:\temp\dtd1.xml', SINGLE_BLOB) orset(BulkColumn)

go

SELECT * FROM t1

go

Regards,

Adrian Hains

Bulkload xml data

Is any one knowing how I bulkload data with characters like to SQL? I have no problem with common English characters. Is it anny parameters in the schema file or what?

Thanks for help Joel

Ps: I youse a schema file like this one...

<?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="namn" dt:type="string" />
<ElementType name="titel" dt:type="string" />
<ElementType name="datum" dt:type="string" />

<ElementType name="ROOT" sql:is-constant="1">
<element type="test" />
</ElementType>

<ElementType name="test" sql:relation="test">
<element type="namn" sql:field="namn" />
<element type="titel" sql:field="titel" />
<element type="datum" sql:field="datum" />
</ElementType>

</Schema>use unicode string type.

Bulkload XML Code

I have several XML file's I need bulkload into SQL 2005.
I have all my code done, but now I ran into another issue.
One of the data tags <pdata> actually contains XML tags. When I try to load
the data I get a data mapping error: Data mapping to column 'pdata' was
already found in the data. Make sure that no two schema definitions map to
the same column.
Is there any way to allow XML tags to bulkload?
I'm using a string data type.
Thanks
Charles WIf you send me the schema and the data I can take a look.
Best regards,
Monica Frintu
"Charles W" wrote:

> I have several XML file's I need bulkload into SQL 2005.
> I have all my code done, but now I ran into another issue.
> One of the data tags <pdata> actually contains XML tags. When I try to loa
d
> the data I get a data mapping error: Data mapping to column 'pdata' was
> already found in the data. Make sure that no two schema definitions map to
> the same column.
> Is there any way to allow XML tags to bulkload?
> I'm using a string data type.
>
> Thanks
> Charles W
>
>

Bulkload with default values

Hello there,
I am trying to import an xml document that have some tags as <tagname/> (so no data). So, when I did the bulk import, I am getting an error message saying the no data provided for <tagname/> and it can't be null. The table I am importing into has a defa
ult value set to blank if no value is presented.
I am trying the following:
... <xsd:element name="ship_to_add_2" default="" sql:field="ship_to_add_2" type="xsd:string"/> ...
The default="" does not do anything? What is going on?
I have to check if default works with simple type elements. If possible, can
you try making the "tagname" an attribute instead of an element and specify
default on it
thanks
Chandra
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Pardeep" <ppuar@.acdsystems.com> wrote in message
news:0F490ED0-AFC0-4C4C-92DB-560E3DB8A8A7@.microsoft.com...
> Hello there,
> I am trying to import an xml document that have some tags as <tagname/>
(so no data). So, when I did the bulk import, I am getting an error message
saying the no data provided for <tagname/> and it can't be null. The table
I am importing into has a default value set to blank if no value is
presented.
> I am trying the following:
> ... <xsd:element name="ship_to_add_2" default="" sql:field="ship_to_add_2"
type="xsd:string"/> ...
> The default="" does not do anything? What is going on?
|||Yes, I can do that and it does work that way. Is it that elements are
not supported?
Thanks
Pardeep
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||default on simple type elements is a bug then.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Pardeep Puar" <ppuar@.acdsystems.com> wrote in message
news:O1DnwFmJEHA.3104@.TK2MSFTNGP10.phx.gbl...
> Yes, I can do that and it does work that way. Is it that elements are
> not supported?
> Thanks
> Pardeep
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||Hi Pardeep,
I tried this and it seems to work for me. Can you post your schema so that I
can investigate what is the issue?
thanks
Chandra
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Chandra Kalyanaraman [MSFT]" <chandrak@.online.microsoft.com> wrote in
message news:%23gxlgqAKEHA.2704@.TK2MSFTNGP10.phx.gbl...
> default on simple type elements is a bug then.
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Pardeep Puar" <ppuar@.acdsystems.com> wrote in message
> news:O1DnwFmJEHA.3104@.TK2MSFTNGP10.phx.gbl...
>
|||Can you please contact me via email and I can sent you my contact
information and we can then chat over the phone about this issue.
ppuar@.acdsystems.com
Thanks
Pardeep
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!

BulkLoad Validation

I am new to XML and XML schemas and have been bashing my head against
a brick wall for too long with the following problem.
I want to use the BulkLoad method to read from an XML file based upon
a schema (XSD), and it should load the data to the SQL database
(SQLServer 2000).
I have included in the schema restrictions for certain fields, using
facets minlength, maxlength, length, to validate the legality of the
XML file during the BulkLoad process.
The BulkLoad works OK when the data is legal.
I want the BulkLoad to skip illegal records if a field has illegal
data.
The schema is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:simpleType name="PANStr">
<xsd:restriction base="xsd:string">
<xsd:minLength value="13" />
<xsd:maxLength value="19" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="AVNStr">
<xsd:restriction base="xsd:string">
<xsd:minLength value="0" />
<xsd:maxLength value="4" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ACStr">
<xsd:restriction base="xsd:string">
<xsd:length value="6" />
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="Config">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="PAN" type="PANStr" />
<xsd:element name="AVN" type="AVNStr" />
<xsd:element name="AC" type="ACStr" />
</xsd:sequence>
</xsd:complexType>
<xsd:key name="ConfigKey1">
<xsd:selector xpath="." />
<xsd:field xpath="PAN" />
</xsd:key>
</xsd:element>
</xsd:schema>
An example of the XML file is as follows:
<?xml version="1.0"?>
<CardValues>
<Config>
<PAN>122112443423</PAN>
<AVN>1112</AVN>
<AC>111111</AC>
</Config>
<Config>
<PAN>235675674574576567</PAN>
<AVN>1115</AVN>
<AC>111111</AC>
</Config>
<Config>
<PAN>123456454563376578900</PAN>
<AVN>1125</AVN>
<AC>111111</AC>
</Config>
</CardValues>
The first record gets written to the SQL table even though the PAN
string length is smaller (12 characters) than the restriction in the
XSD (minlength=13).
The second record gets written to the SQL table (as expected).
The third record triggers the expected error: Type of column 'PAN' in
table 'Config' is too small to hold data
'12211777777777777777777777777777777777777'
I'm under the impression that the third record fails not due to the
maxlength restriction in the schema, but because the field in the
underlying SQL table has a length of 19. That is the reason that only
the maxlength restriction is working as expected.
Any advice would greatly be appreciated
Hi,
The SQLXMLBulkload component does not validate the input XML against the
supplied XSD. For example, facets like minlength and maxlength do not make
any difference to the Bulkload process. I hope this clarifies the issue.
Thank you,
Amar Nalla
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>From: gosela@.netvision.net.il (Gidon Sela)
>Newsgroups: microsoft.public.sqlserver.xml
>Subject: BulkLoad Validation
>Date: 15 Apr 2004 11:48:31 -0700
>Organization: http://groups.google.com
>Lines: 89
>Message-ID: <b840dd4e.0404151048.7d0aeefe@.posting.google.com >
>NNTP-Posting-Host: 212.235.13.114
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1082054912 10201 127.0.0.1 (15 Apr 2004
18:48:32 GMT)
>X-Complaints-To: groups-abuse@.google.com
>NNTP-Posting-Date: Thu, 15 Apr 2004 18:48:32 +0000 (UTC)
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news.glorb.com!postnews1.google.com!not-for-mail
>Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.xml:22246
>X-Tomcat-NG: microsoft.public.sqlserver.xml
>I am new to XML and XML schemas and have been bashing my head against
>a brick wall for too long with the following problem.
>I want to use the BulkLoad method to read from an XML file based upon
>a schema (XSD), and it should load the data to the SQL database
>(SQLServer 2000).
>I have included in the schema restrictions for certain fields, using
>facets minlength, maxlength, length, to validate the legality of the
>XML file during the BulkLoad process.
>The BulkLoad works OK when the data is legal.
>I want the BulkLoad to skip illegal records if a field has illegal
>data.
>The schema is as follows:
><?xml version="1.0" encoding="utf-8" ?>
><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
> <xsd:simpleType name="PANStr">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="13" />
> <xsd:maxLength value="19" />
> </xsd:restriction>
> </xsd:simpleType>
> <xsd:simpleType name="AVNStr">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="0" />
> <xsd:maxLength value="4" />
> </xsd:restriction>
> </xsd:simpleType>
> <xsd:simpleType name="ACStr">
> <xsd:restriction base="xsd:string">
> <xsd:length value="6" />
> </xsd:restriction>
> </xsd:simpleType>
> <xsd:element name="Config">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="PAN" type="PANStr" />
> <xsd:element name="AVN" type="AVNStr" />
> <xsd:element name="AC" type="ACStr" />
> </xsd:sequence>
> </xsd:complexType>
> <xsd:key name="ConfigKey1">
> <xsd:selector xpath="." />
> <xsd:field xpath="PAN" />
> </xsd:key>
> </xsd:element>
></xsd:schema>
>
>An example of the XML file is as follows:
><?xml version="1.0"?>
><CardValues>
> <Config>
> <PAN>122112443423</PAN>
> <AVN>1112</AVN>
> <AC>111111</AC>
> </Config>
> <Config>
> <PAN>235675674574576567</PAN>
> <AVN>1115</AVN>
> <AC>111111</AC>
> </Config>
> <Config>
> <PAN>123456454563376578900</PAN>
> <AVN>1125</AVN>
> <AC>111111</AC>
> </Config>
></CardValues>
>The first record gets written to the SQL table even though the PAN
>string length is smaller (12 characters) than the restriction in the
>XSD (minlength=13).
>The second record gets written to the SQL table (as expected).
>The third record triggers the expected error: Type of column 'PAN' in
>table 'Config' is too small to hold data
>'12211777777777777777777777777777777777777'
>I'm under the impression that the third record fails not due to the
>maxlength restriction in the schema, but because the field in the
>underlying SQL table has a length of 19. That is the reason that only
>the maxlength restriction is working as expected.
>Any advice would greatly be appreciated
>
|||Thanks for reply.
If I can't use BulkLoad to also verify the XML data before loading it
to SQL DB, what should I do to load and verify the XML data. The XML
file is very large, and speed is of an essence.
Thanks
Gidon
amarna@.online.microsoft.com ("Amar Nalla [MSFT]") wrote in message news:<027zS5JJEHA.4016@.cpmsftngxa10.phx.gbl>...[vbcol=seagreen]
> Hi,
> The SQLXMLBulkload component does not validate the input XML against the
> supplied XSD. For example, facets like minlength and maxlength do not make
> any difference to the Bulkload process. I hope this clarifies the issue.
> Thank you,
> Amar Nalla
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --
> 18:48:32 GMT)
> cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
> e.de!news.glorb.com!postnews1.google.com!not-for-mail
|||Are you using native or managed code? The appropriate solution in the given
enviornment should be used.
Irwin
This posting is provided "AS IS" with no warranties, and confers no rights
"Gidon Sela" <gosela@.netvision.net.il> wrote in message
news:b840dd4e.0404190622.1704bb43@.posting.google.c om...[vbcol=seagreen]
> Thanks for reply.
> If I can't use BulkLoad to also verify the XML data before loading it
> to SQL DB, what should I do to load and verify the XML data. The XML
> file is very large, and speed is of an essence.
> Thanks
> Gidon
> amarna@.online.microsoft.com ("Amar Nalla [MSFT]") wrote in message
> news:<027zS5JJEHA.4016@.cpmsftngxa10.phx.gbl>...
|||I am using managed code (VB.NET)
"Irwin Dolobowsky [MS]" <irwind@.mail.microsoft.com> wrote in message news:<#nZC$GmJEHA.2464@.TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> Are you using native or managed code? The appropriate solution in the given
> enviornment should be used.
> Irwin
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Gidon Sela" <gosela@.netvision.net.il> wrote in message
> news:b840dd4e.0404190622.1704bb43@.posting.google.c om...
> 18:48:32 GMT)
|||You'd have to use the XmlValidatingReader to first read through the data to
validate it. Then you could pass it to bulkload.
Check it out here:
http://msdn.microsoft.com/library/de...mberstopic.asp
Irwin
--
Irwin Dolobowsky
Program Manager - SqlXml
This posting is provided "AS IS" with no warranties, and confers no rights.
"Gidon Sela" <gosela@.netvision.net.il> wrote in message
news:b840dd4e.0404210212.3e187104@.posting.google.c om...[vbcol=seagreen]
>I am using managed code (VB.NET)
> "Irwin Dolobowsky [MS]" <irwind@.mail.microsoft.com> wrote in message
> news:<#nZC$GmJEHA.2464@.TK2MSFTNGP10.phx.gbl>...

BulkLoad question

In order to upload data using SQLXML Bulkload, must the data and schema
reside in a file, or can you store the data to a variable, then use Bulkload
?The schema must be in a file. The data can be in a file or an input stream.
Andrew Conrad
Microsoft Corp

BulkLoad question

In order to upload data using SQLXML Bulkload, must the data and schema
reside in a file, or can you store the data to a variable, then use Bulkload
?
The schema must be in a file. The data can be in a file or an input stream.
Andrew Conrad
Microsoft Corp

BulkLoad Problem

Anyone know why this will not work... when I run the script it just inserts
one blank row... No Data !
The Script...
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBL.ConnectionString = "provider=SQLOLEDB;data
source=localhost;database=SqlXmlTest;integrated security=SSPI"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "C:\Schema1.xml", "C:\Test.xml"
set objBL=Nothing
The Schema...
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:relation="Invoices" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" type="xsd:string" />
<xsd:element name="Supplier" type="xsd:string" />
<xsd:element name="NetAmount" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The Data...
<?xml version="1.0"?><Invoices><Invoice id="4F10OKGRR91" Supplier="501122"
NetAmount="52.17" /><Invoice id="4F10OPPRR41" Supplier="501122"
NetAmount="100.00" /><Invoice id="4F18LXLDE51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F18LXXCJ72" Supplier="176696"
NetAmount="1000.00" /><Invoice id="4F18O9TJM31" Supplier="176580"
NetAmount="593.60" /><Invoice id="4F21JBLHK81" Supplier="100900"
NetAmount="17990.00" /><Invoice id="4F21K2SPU51" Supplier="100900"
NetAmount="449.50" /><Invoice id="4F21OXHKI11" Supplier="503972"
NetAmount="382.10" /><Invoice id="4F22IMTLO61" Supplier="176534"
NetAmount="669.86" /><Invoice id="4F22L1JCD54" Supplier="176596"
NetAmount="150.00" /><Invoice id="4F22L1OQF72" Supplier="176542"
NetAmount="4.66" /><Invoice id="4F22L1UQJ51" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F22L1VSM43" Supplier="176542"
NetAmount="20.00" /><Invoice id="4F23NIPEO42" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F23NIYCG21" Supplier="176542"
NetAmount="100.00" /><Invoice id="4F28PTYGJ51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F28PUOST42" Supplier="503302"
NetAmount="105.00" /><Invoice id="4G01LBMTJ81" Supplier="176696"
NetAmount="" /><Invoice id="4H20KTFGH31" Supplier="948650"
NetAmount="3083.14" /><Invoice id="4H20KTFVC32" Supplier="948650"
NetAmount="22536.02" /><Invoice id="4H20NTSPE91" Supplier="503302"
NetAmount="107.10" /><Invoice id="4H23IVGMK51" Supplier="176157"
NetAmount="40.54" /><Invoice id="4H30JEIMH21" Supplier="948650"
NetAmount="68.66" /></Invoices>
The Table...
CREATE TABLE [dbo].[Invoices] (
[Invoice] [char] (50) COLLATE Latin1_General_BIN NULL ,
[Supplier] [char] (50) COLLATE Latin1_General_BIN NULL ,
[NetAmount] [char] (50) COLLATE Latin1_General_BIN NULL
) ON [PRIMARY]
Your schema doesn't actually describe your XML. Try something like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:is-constant="1" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" sql:relation="Invoices" />
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" sql:field=
"Invoice"/>
<xsd:attribute name="Supplier" type="xsd:string" sql:field=
"Supplier"/>
<xsd:attribute name="NetAmount" type="xsd:string"
sql:field="NetAmount"/>
</xsd:complexType>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Rob C" <RobC@.discussions.microsoft.com> wrote in message
news:72538FD0-A75B-483F-A549-37C993C21432@.microsoft.com...
Anyone know why this will not work... when I run the script it just inserts
one blank row... No Data !
The Script...
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBL.ConnectionString = "provider=SQLOLEDB;data
source=localhost;database=SqlXmlTest;integrated security=SSPI"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "C:\Schema1.xml", "C:\Test.xml"
set objBL=Nothing
The Schema...
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:relation="Invoices" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" type="xsd:string" />
<xsd:element name="Supplier" type="xsd:string" />
<xsd:element name="NetAmount" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The Data...
<?xml version="1.0"?><Invoices><Invoice id="4F10OKGRR91" Supplier="501122"
NetAmount="52.17" /><Invoice id="4F10OPPRR41" Supplier="501122"
NetAmount="100.00" /><Invoice id="4F18LXLDE51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F18LXXCJ72" Supplier="176696"
NetAmount="1000.00" /><Invoice id="4F18O9TJM31" Supplier="176580"
NetAmount="593.60" /><Invoice id="4F21JBLHK81" Supplier="100900"
NetAmount="17990.00" /><Invoice id="4F21K2SPU51" Supplier="100900"
NetAmount="449.50" /><Invoice id="4F21OXHKI11" Supplier="503972"
NetAmount="382.10" /><Invoice id="4F22IMTLO61" Supplier="176534"
NetAmount="669.86" /><Invoice id="4F22L1JCD54" Supplier="176596"
NetAmount="150.00" /><Invoice id="4F22L1OQF72" Supplier="176542"
NetAmount="4.66" /><Invoice id="4F22L1UQJ51" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F22L1VSM43" Supplier="176542"
NetAmount="20.00" /><Invoice id="4F23NIPEO42" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F23NIYCG21" Supplier="176542"
NetAmount="100.00" /><Invoice id="4F28PTYGJ51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F28PUOST42" Supplier="503302"
NetAmount="105.00" /><Invoice id="4G01LBMTJ81" Supplier="176696"
NetAmount="" /><Invoice id="4H20KTFGH31" Supplier="948650"
NetAmount="3083.14" /><Invoice id="4H20KTFVC32" Supplier="948650"
NetAmount="22536.02" /><Invoice id="4H20NTSPE91" Supplier="503302"
NetAmount="107.10" /><Invoice id="4H23IVGMK51" Supplier="176157"
NetAmount="40.54" /><Invoice id="4H30JEIMH21" Supplier="948650"
NetAmount="68.66" /></Invoices>
The Table...
CREATE TABLE [dbo].[Invoices] (
[Invoice] [char] (50) COLLATE Latin1_General_BIN NULL ,
[Supplier] [char] (50) COLLATE Latin1_General_BIN NULL ,
[NetAmount] [char] (50) COLLATE Latin1_General_BIN NULL
) ON [PRIMARY]
|||Oops! Sorry, I meant:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:is-constant="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" sql:relation="Invoices">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" sql:field="Invoice"
/>
<xsd:attribute name="Supplier" type="xsd:string"
sql:field="Supplier" />
<xsd:attribute name="NetAmount" type="xsd:string"
sql:field="NetAmount" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Cheers,
Graeme
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Graeme Malcolm" <graemem_cm@.hotmail.com> wrote in message
news:u0GX%23FYpEHA.3392@.TK2MSFTNGP15.phx.gbl...
Your schema doesn't actually describe your XML. Try something like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:is-constant="1" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" sql:relation="Invoices" />
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" sql:field=
"Invoice"/>
<xsd:attribute name="Supplier" type="xsd:string" sql:field=
"Supplier"/>
<xsd:attribute name="NetAmount" type="xsd:string"
sql:field="NetAmount"/>
</xsd:complexType>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--
Graeme Malcolm
Principal Technologist
Content Master Ltd.
www.contentmaster.com
"Rob C" <RobC@.discussions.microsoft.com> wrote in message
news:72538FD0-A75B-483F-A549-37C993C21432@.microsoft.com...
Anyone know why this will not work... when I run the script it just inserts
one blank row... No Data !
The Script...
set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBL.ConnectionString = "provider=SQLOLEDB;data
source=localhost;database=SqlXmlTest;integrated security=SSPI"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "C:\Schema1.xml", "C:\Test.xml"
set objBL=Nothing
The Schema...
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Invoices" sql:relation="Invoices" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Invoice" type="xsd:string" />
<xsd:element name="Supplier" type="xsd:string" />
<xsd:element name="NetAmount" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
The Data...
<?xml version="1.0"?><Invoices><Invoice id="4F10OKGRR91" Supplier="501122"
NetAmount="52.17" /><Invoice id="4F10OPPRR41" Supplier="501122"
NetAmount="100.00" /><Invoice id="4F18LXLDE51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F18LXXCJ72" Supplier="176696"
NetAmount="1000.00" /><Invoice id="4F18O9TJM31" Supplier="176580"
NetAmount="593.60" /><Invoice id="4F21JBLHK81" Supplier="100900"
NetAmount="17990.00" /><Invoice id="4F21K2SPU51" Supplier="100900"
NetAmount="449.50" /><Invoice id="4F21OXHKI11" Supplier="503972"
NetAmount="382.10" /><Invoice id="4F22IMTLO61" Supplier="176534"
NetAmount="669.86" /><Invoice id="4F22L1JCD54" Supplier="176596"
NetAmount="150.00" /><Invoice id="4F22L1OQF72" Supplier="176542"
NetAmount="4.66" /><Invoice id="4F22L1UQJ51" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F22L1VSM43" Supplier="176542"
NetAmount="20.00" /><Invoice id="4F23NIPEO42" Supplier="176696"
NetAmount="1200.00" /><Invoice id="4F23NIYCG21" Supplier="176542"
NetAmount="100.00" /><Invoice id="4F28PTYGJ51" Supplier="176696"
NetAmount="5150.00" /><Invoice id="4F28PUOST42" Supplier="503302"
NetAmount="105.00" /><Invoice id="4G01LBMTJ81" Supplier="176696"
NetAmount="" /><Invoice id="4H20KTFGH31" Supplier="948650"
NetAmount="3083.14" /><Invoice id="4H20KTFVC32" Supplier="948650"
NetAmount="22536.02" /><Invoice id="4H20NTSPE91" Supplier="503302"
NetAmount="107.10" /><Invoice id="4H23IVGMK51" Supplier="176157"
NetAmount="40.54" /><Invoice id="4H30JEIMH21" Supplier="948650"
NetAmount="68.66" /></Invoices>
The Table...
CREATE TABLE [dbo].[Invoices] (
[Invoice] [char] (50) COLLATE Latin1_General_BIN NULL ,
[Supplier] [char] (50) COLLATE Latin1_General_BIN NULL ,
[NetAmount] [char] (50) COLLATE Latin1_General_BIN NULL
) ON [PRIMARY]
|||Thank you ! I am very grateful for your help.
Cheers,
Rob
"Graeme Malcolm" <graemem_cm@.hotmail.com> wrote in message
news:OomSYYYpEHA.3716@.TK2MSFTNGP10.phx.gbl...
> Oops! Sorry, I meant:
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="Invoices" sql:is-constant="1">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Invoice" sql:relation="Invoices">
> <xsd:complexType>
> <xsd:attribute name="id" type="xsd:string" sql:field="Invoice"
> />
> <xsd:attribute name="Supplier" type="xsd:string"
> sql:field="Supplier" />
> <xsd:attribute name="NetAmount" type="xsd:string"
> sql:field="NetAmount" />
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> Cheers,
> Graeme
> --
> Graeme Malcolm
> Principal Technologist
> Content Master Ltd.
> www.contentmaster.com
>
> "Graeme Malcolm" <graemem_cm@.hotmail.com> wrote in message
> news:u0GX%23FYpEHA.3392@.TK2MSFTNGP15.phx.gbl...
> Your schema doesn't actually describe your XML. Try something like this:
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="Invoices" sql:is-constant="1" >
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Invoice" sql:relation="Invoices" />
> <xsd:complexType>
> <xsd:attribute name="id" type="xsd:string" sql:field=
> "Invoice"/>
> <xsd:attribute name="Supplier" type="xsd:string" sql:field=
> "Supplier"/>
> <xsd:attribute name="NetAmount" type="xsd:string"
> sql:field="NetAmount"/>
> </xsd:complexType>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> --
> --
> Graeme Malcolm
> Principal Technologist
> Content Master Ltd.
> www.contentmaster.com
>
> "Rob C" <RobC@.discussions.microsoft.com> wrote in message
> news:72538FD0-A75B-483F-A549-37C993C21432@.microsoft.com...
> Anyone know why this will not work... when I run the script it just
> inserts
> one blank row... No Data !
> The Script...
> set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
> objBL.ConnectionString = "provider=SQLOLEDB;data
> source=localhost;database=SqlXmlTest;integrated security=SSPI"
> objBL.ErrorLogFile = "c:\error.log"
> objBL.Execute "C:\Schema1.xml", "C:\Test.xml"
> set objBL=Nothing
> The Schema...
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="Invoices" sql:relation="Invoices" >
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="Invoice" type="xsd:string" />
> <xsd:element name="Supplier" type="xsd:string" />
> <xsd:element name="NetAmount" type="xsd:string" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> The Data...
> <?xml version="1.0"?><Invoices><Invoice id="4F10OKGRR91" Supplier="501122"
> NetAmount="52.17" /><Invoice id="4F10OPPRR41" Supplier="501122"
> NetAmount="100.00" /><Invoice id="4F18LXLDE51" Supplier="176696"
> NetAmount="5150.00" /><Invoice id="4F18LXXCJ72" Supplier="176696"
> NetAmount="1000.00" /><Invoice id="4F18O9TJM31" Supplier="176580"
> NetAmount="593.60" /><Invoice id="4F21JBLHK81" Supplier="100900"
> NetAmount="17990.00" /><Invoice id="4F21K2SPU51" Supplier="100900"
> NetAmount="449.50" /><Invoice id="4F21OXHKI11" Supplier="503972"
> NetAmount="382.10" /><Invoice id="4F22IMTLO61" Supplier="176534"
> NetAmount="669.86" /><Invoice id="4F22L1JCD54" Supplier="176596"
> NetAmount="150.00" /><Invoice id="4F22L1OQF72" Supplier="176542"
> NetAmount="4.66" /><Invoice id="4F22L1UQJ51" Supplier="176696"
> NetAmount="1200.00" /><Invoice id="4F22L1VSM43" Supplier="176542"
> NetAmount="20.00" /><Invoice id="4F23NIPEO42" Supplier="176696"
> NetAmount="1200.00" /><Invoice id="4F23NIYCG21" Supplier="176542"
> NetAmount="100.00" /><Invoice id="4F28PTYGJ51" Supplier="176696"
> NetAmount="5150.00" /><Invoice id="4F28PUOST42" Supplier="503302"
> NetAmount="105.00" /><Invoice id="4G01LBMTJ81" Supplier="176696"
> NetAmount="" /><Invoice id="4H20KTFGH31" Supplier="948650"
> NetAmount="3083.14" /><Invoice id="4H20KTFVC32" Supplier="948650"
> NetAmount="22536.02" /><Invoice id="4H20NTSPE91" Supplier="503302"
> NetAmount="107.10" /><Invoice id="4H23IVGMK51" Supplier="176157"
> NetAmount="40.54" /><Invoice id="4H30JEIMH21" Supplier="948650"
> NetAmount="68.66" /></Invoices>
> The Table...
> CREATE TABLE [dbo].[Invoices] (
> [Invoice] [char] (50) COLLATE Latin1_General_BIN NULL ,
> [Supplier] [char] (50) COLLATE Latin1_General_BIN NULL ,
> [NetAmount] [char] (50) COLLATE Latin1_General_BIN NULL
> ) ON [PRIMARY]
>
>
>

BulkLoad Line Breaks

Hey,
Does anyone know if there is a way around XML Bulkload removing line breaks
that should be imported from xml to sql?
Thanks.
cd
Where are the linebreaks? The XML parsers have some specific rules about
line breaks that may remove them (inside attributes) or normalize them to
linefeed. If you want to not have this happen, you need to entitize them
(e.g., use for linefeed etc.)
Best regards
Michael
<CDONNICK@.wi.rr.com> wrote in message
news:mBSnd.164$%76.114@.twister.rdc-kc.rr.com...
> Hey,
> Does anyone know if there is a way around XML Bulkload removing line
> breaks that should be imported from xml to sql?
> Thanks.
> cd
>

Bulkload in webservice

Seems like a cannot use bulkload in my webservice. Get the error:
InvalidCastException: QueryInterface for interface
SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed.
The code works with windows application.
Hoping that someone can help me with this problem. It has halted the project
for over a week!
My kode:
My webservice:
Public Function LagreStilingsannonse(ByVal XML As System.Xml.XmlElement,
ByVal AutorisasjonsStreng As String) As Long
Dim serviceModule1 As ServerContax.ServiceModule = New
ServerContax.ServiceModule
Return serviceModule1.LagreA(XML) 'Lagrer xml shemaet
End Function 'LagreStilingsannonse
Heres the code for the service module (its not a module, but a class, just a
name):
Friend Function LagreA(ByVal XMLelement As System.Xml.XmlElement) As Long
Private dbstreng2 As String
="Provider=sqloledb;server=TEAMSERVER;database=XML ;UserID=testBruker;Password=test" ‘<- works
Private savepath As String = "C:"
<-code clipped->
Dim objBL As SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class = New
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class
objBL.ConnectionString = dbstreng2 '<- Here it fail with: InvalidCastException
objBL.ErrorLogFile = savepath + "\" + "error.log"
objBL.CheckConstraints = False
objBL.TempFilePath = savepath
objBL.BulkLoad = True
objBL.SGDropTables = False
objBL.SchemaGen = True
objBL.Execute(savepath & "\" & XSD, datastream)
return 0
end function
Appreciate any help!
Marius Pettersen
..Net developer
MP Productions
From what I have read, you can't execute a bulk load in a multi-threaded
environment. You need to instantiate a single thread and then perform
the bulk load. Once I set that up, I got past the problem you are
having, but I am unable to connect to my database. If you get past
that problem, please let me know.
Private Sub BulkLoadXML()
Dim bulkload As New Thread(New ThreadStart(AddressOf
ExecuteBulkCall))
bulkload.ApartmentState = ApartmentState.STA
bulkload.Start()
bulkload.Join()
End Sub
Private Sub ExecuteBulkCall()
Dim _bulkInstance As New SQLXMLBulkLoad3Class
_bulkInstance.ConnectionString = _strConn
_bulkInstance.ErrorLogFile = "c:\temp\xmlerror.log"
_bulkInstance.KeepIdentity = False
_bulkInstance.Execute("c:\SampleSchema.xsd",
"c:\SampleXMLData.xml")
End Sub
franksag
Posted via http://www.codecomments.com
|||Yes, I figure i could solve it like this, but the method has the xml as
argument. I cant put an argument in a AdressOf method.
Anyway, can I do this? How can we send information to a thred?
franksag: What you can do is copy the code/method to a windows or console
application. Then you can se if it's working.
My code works fine in a windows application.
"franksag" wrote:

> From what I have read, you can't execute a bulk load in a multi-threaded
> environment. You need to instantiate a single thread and then perform
> the bulk load. Once I set that up, I got past the problem you are
> having, but I am unable to connect to my database. If you get past
> that problem, please let me know.
> Private Sub BulkLoadXML()
> Dim bulkload As New Thread(New ThreadStart(AddressOf
> ExecuteBulkCall))
> bulkload.ApartmentState = ApartmentState.STA
> bulkload.Start()
> bulkload.Join()
> End Sub
> Private Sub ExecuteBulkCall()
> Dim _bulkInstance As New SQLXMLBulkLoad3Class
> _bulkInstance.ConnectionString = _strConn
> _bulkInstance.ErrorLogFile = "c:\temp\xmlerror.log"
> _bulkInstance.KeepIdentity = False
> _bulkInstance.Execute("c:\SampleSchema.xsd",
> "c:\SampleXMLData.xml")
> End Sub
>
> --
> franksag
> Posted via http://www.codecomments.com
>

Bulkload in webservice

Seems like a cannot use bulkload in my webservice. Get the error:
InvalidCastException: QueryInterface for interface
SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed.
The code works with windows application.
Hoping that someone can help me with this problem. It has halted the project
for over a w!
My kode:
My webservice:
Public Function LagreStilingsannonse(ByVal XML As System.Xml.XmlElement,
ByVal AutorisasjonsStreng As String) As Long
Dim serviceModule1 As ServerContax.ServiceModule = New
ServerContax.ServiceModule
Return serviceModule1.LagreA(XML) 'Lagrer xml shemaet
End Function 'LagreStilingsannonse
Heres the code for the service module (its not a module, but a class, just a
name):
Friend Function LagreA(ByVal XMLelement As System.Xml.XmlElement) As Long
Private dbstreng2 As String
=" Provider=sqloledb;server=TEAMSERVER;data
base=XML;UserID=testBruker;Passwor
d=test" ‘<- works
Private savepath As String = "C:"
<-code clipped->
Dim objBL As SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class = New
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class
objBL.ConnectionString = dbstreng2 '<- Here it fail with: InvalidCastExcepti
on
objBL.ErrorLogFile = savepath + "\" + "error.log"
objBL.CheckConstraints = False
objBL.TempFilePath = savepath
objBL.BulkLoad = True
objBL.SGDropTables = False
objBL.SchemaGen = True
objBL.Execute(savepath & "\" & XSD, datastream)
return 0
end function
Appreciate any help!
--
Marius Pettersen
.Net developer
MP ProductionsFrom what I have read, you can't execute a bulk load in a multi-threaded env
ironment. You need to instantiate a single thread and then perform the bulk
load. Once I set that up, I got past the problem you are having, but I am
unable to connect to my database. If you get past that problem, please let
me know.
Private Sub BulkLoadXML()
Dim bulkload As New Thread(New ThreadStart(AddressOf ExecuteBulkCall
))
bulkload.ApartmentState = ApartmentState.STA
bulkload.Start()
bulkload.Join()
End Sub
Private Sub ExecuteBulkCall()
Dim _bulkInstance As New SQLXMLBulkLoad3Class
_bulkInstance.ConnectionString = _strConn
_bulkInstance.ErrorLogFile = "c:\temp\xmlerror.log"
_bulkInstance.KeepIdentity = False
_bulkInstance.Execute("c:\SampleSchema.xsd", "c:\SampleXMLData.xml")
End Sub|||Yes, I figure i could solve it like this, but the method has the xml as
argument. I cant put an argument in a AdressOf method.
Anyway, can I do this? How can we send information to a thred?
franksag: What you can do is copy the code/method to a windows or console
application. Then you can se if it's working.
My code works fine in a windows application.
"franksag" wrote:

> From what I have read, you can't execute a bulk load in a multi-threaded
> environment. You need to instantiate a single thread and then perform
> the bulk load. Once I set that up, I got past the problem you are
> having, but I am unable to connect to my database. If you get past
> that problem, please let me know.
> Private Sub BulkLoadXML()
> Dim bulkload As New Thread(New ThreadStart(AddressOf
> ExecuteBulkCall))
> bulkload.ApartmentState = ApartmentState.STA
> bulkload.Start()
> bulkload.Join()
> End Sub
> Private Sub ExecuteBulkCall()
> Dim _bulkInstance As New SQLXMLBulkLoad3Class
> _bulkInstance.ConnectionString = _strConn
> _bulkInstance.ErrorLogFile = "c:\temp\xmlerror.log"
> _bulkInstance.KeepIdentity = False
> _bulkInstance.Execute("c:\SampleSchema.xsd",
> "c:\SampleXMLData.xml")
> End Sub
>
> --
> franksag
> ---
> Posted via http://www.codecomments.com
> ---
>

BulkLoad in multiple tables - How to write the annotations?

My Problem: I have to import XML-Files into a complex SQlServer-DB (20
Tables,m2n-relations) via XML Bulkload.
The annotations in the Mapping-Scheme looks like:
--
<sql:relationship name="RLS_LUN" parent="RLS" parent-key="RLS_ID"
child="LUN" child-key="RLS_ID"/>
--
The elements (tablenames) are annotated with:
<xs:element name="LUN" sql:relation="LUN" sql:relationship="RLS_LUN">
--
At executing the Script for Bulkload the following error message appears:
--
Schema: the parent/child table of the relationship on 'DPI' does not match.
--
Some facts:
The tablefields are attributes.
The tables have IDs as identity-columns (must add them as attribute?)
What and where is the problem?
It would be very nice, if someone could help me, it′s important for me,
thank you in advanceThe error you received indicates that the parent and child relations in
your sql:relationship are inconsistent with the relations defined on the
parent and child sides of the relationship.
In addition, the error specifies a relationship not included in your
orginal post (DPI). Posting the entire mapping schema would probably help.
Andrew Conrad
Microsoft Corp|||Now my updated schema (still not working, but why?!?!?):
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by Schlagl
Susanne (-) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:dt="urn:schemas-microsoft-com:datatypes" elementFormDefault="qualified
"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:appinfo>
<sql:relationship name="IPI_ISR" parent="IPI" parent-key="IPI_ID"
child="ISR" child-key="IPI_ID"/>
<sql:relationship name="Node_PPI" parent="Node" parent-key="Node_ID"
child="PPI" child-key="Node_ID"/>
<sql:relationship name="PPI_PTT" parent="PPI" parent-key="PPI_ID"
child="PTT" child-key="PPI_ID"/>
<sql:relationship name="PPI_DPT" parent="PPI" parent-key="PPI_ID"
child="DPT" child-key="PPI_ID"/>
<sql:relationship name="Node_ZPI" parent="Node" parent-key="Node_ID"
child="ZPI" child-key="Node_ID"/>
<sql:relationship name="ZPI_DOT" parent="ZPI" parent-key="ZPI_ID"
child="DOT" child-key="ZPI_ID"/>
<sql:relationship name="Node_ORS" parent="Node" parent-key="Node_ID"
child="ORS" child-key="Node_ID"/>
<sql:relationship name="Node_IDS" parent="Node" parent-key="Node_ID"
child="IDS" child-key="Node_ID"/>
<sql:relationship name="IDS_IBS" parent="IDS" parent-key="IDS_ID"
child="IBS" child-key="IDS_ID"/>
<sql:relationship name="Node_RLS" parent="Node" parent-key="Node_ID"
child="RLS" child-key="Node_ID"/>
<sql:relationship name="RLS_LUN" parent="RLS" parent-key="RLS_ID"
child="LUN" child-key="RLS_ID"/>
<sql:relationship name="Node_ORH" parent="Node" parent-key="Node_ID"
child="ORH" child-key="Node_ID"/>
<sql:relationship name="ORH_RHC" parent="ORH" parent-key="ORH_ID"
child="RHC" child-key="ORH_ID"/>
<sql:relationship name="Node_SDS" parent="Node" parent-key="Node_ID"
child="SDS" child-key="Node_ID"/>
<sql:relationship name="Node_ORB" parent="Node" parent-key="Node_ID"
child="ORB" child-key="Node_ID"/>
<sql:relationship name="ORB_RBL" parent="ORB" parent-key="ORB_ID"
child="RBL" child-key="ORB_ID"/>
<sql:relationship name="Node_SST" parent="Node" parent-key="Node_ID"
child="SST" child-key="Node_ID"/>
<sql:relationship name="Node_PSI" parent="Node" parent-key="Node_ID"
child="PSI" child-key="Node_ID"/>
<sql:relationship name="PSI_PRS" parent="PSI" parent-key="PSI_ID"
child="PRS" child-key="PSI_ID"/>
<sql:relationship name="Node_OPS" parent="Node" parent-key="Node_ID"
child="OPS" child-key="Node_ID"/>
<sql:relationship name="OPS_PSR" parent="OPS" parent-key="OPS_ID"
child="PSR" child-key="OPS_ID"/>
<sql:relationship name="Node_LFS" parent="Node" parent-key="Node_ID"
child="LFS" child-key="Node_ID"/>
<sql:relationship name="LFS_ILF" parent="LFS" parent-key="LFS_ID"
child="ILF" child-key="LFS_ID"/>
<sql:relationship name="ILF_LFA" parent="ILF" parent-key="ILF_ID"
child="LFA" child-key="ILF_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:element name="SPR" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NODE" sql:relation="NODE">
<xs:complexType>
<xs:sequence>
<xs:element name="DPI" sql:relation="DPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="Node" parent-key="Node_ID" child="DPI"
child-key="Node_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="AQS" sql:relation="AQS">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="AQS"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="rqt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rtc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rqs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="AQS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OPI" sql:relation="OPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="OPI"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="did" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="odc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OVE" sql:relation="OVE">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="OVE"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="vid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="vck" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="arn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="vst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="srq" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dck" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OVE_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="TSQ" sql:relation="TSQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="TSQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="xsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsk" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsi" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="TSQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="CPQ" sql:relation="CPQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="CPQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="fci" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="fsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="fps" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="CPQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="WLQ" sql:relation="WLQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="WLQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="wrc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wrt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wrs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="WLQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="BLQ" sql:relation="BLQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="BLQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="ect" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="bec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="BLQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="EXL" sql:relation="EXL">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="EXL"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="nxl" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="EXL_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
<xs:attribute name="tsqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ovec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="blqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="opic" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dpt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wlqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="exlc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cpqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="aqsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
<xs:element name="IPI" sql:relation="IPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="Node" parent-key="Node_ID" child="IPI"
child-key="Node_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="ISR" sql:relation="ISR"
sql:relationship="IPI_ISR">
<xs:complexType>
<xs:attribute name="iss" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="itt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ihp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ipu" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="iku" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="itn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ISR_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="iht" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="IPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PPI" sql:relation="PPI" sql:relationship="Node_PPI">
<xs:complexType>
<xs:sequence>
<xs:element name="DPT" sql:relation="DPT"
sql:relationship="PPI_DPT">
<xs:complexType>
<xs:attribute name="lst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="tts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lsp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pok" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="DPT_ID" type="xs:integer" use="optional"/>
<xs:attribute name="PPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PTT" sql:relation="PTT"
sql:relationship="PPI_PTT">
<xs:complexType>
<xs:attribute name="PTT_ID" type="xs:string" use="optional"/>
<xs:attribute name="PPI_ID" type="xs:string" use="optional"/>
<xs:attribute name="xus" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xok" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xnt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="dkt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ZPI" sql:relation="ZPI" sql:relationship="Node_ZPI">
<xs:complexType>
<xs:sequence>
<xs:element name="DOT" sql:relation="DOT"
sql:relationship="ZPI_DOT">
<xs:complexType>
<xs:attribute name="ook" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ons" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="osp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="onm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ost" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="DOT_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ZPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="okt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ZPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORS" sql:relation="ORS" sql:relationship="Node_ORS">
<xs:complexType>
<xs:sequence>
<xs:element name="ARD" sql:relation="ARD">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="ORS" parent-key="ORS_ID" child="ARD"
child-key="ORS_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="sid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lns" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="mid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lds" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ARD_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ORS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="IDS" sql:relation="IDS" sql:relationship="Node_IDS">
<xs:complexType>
<xs:sequence>
<xs:element name="IBS" sql:relation="IBS"
sql:relationship="IDS_IBS">
<xs:complexType>
<xs:attribute name="bus" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="bkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="IDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IBS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="IDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IBS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="RLS" sql:relation="RLS" sql:relationship="Node_RLS">
<xs:complexType>
<xs:sequence>
<xs:element name="LUN" sql:relation="LUN"
sql:relationship="RLS_LUN">
<xs:complexType>
<xs:attribute name="lkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LUN_ID" type="xs:integer" use="optional"/>
<xs:attribute name="RLS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="RLS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORH" sql:relation="ORH" sql:relationship="Node_ORH">
<xs:complexType>
<xs:sequence>
<xs:element name="RHC" sql:relation="RHC"
sql:relationship="ORH_RHC">
<xs:complexType>
<xs:attribute name="shn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="RHC_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORH_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ORH_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="SDS" sql:relation="SDS" sql:relationship="Node_SDS">
<xs:complexType>
<xs:attribute name="ddt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sdc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sds" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="SDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORB" sql:relation="ORB" sql:relationship="Node_ORB">
<xs:complexType>
<xs:sequence>
<xs:element name="RBL" sql:relation="RBL"
sql:relationship="ORB_RBL">
<xs:complexType>
<xs:attribute name="rxd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rmd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rdc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="blc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="RBL_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORB_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rbc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ORB_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="SST" sql:relation="SST" sql:relationship="Node_SST">
<xs:complexType>
<xs:attribute name="ssc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="SST_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PSI" sql:relation="PSI" sql:relationship="Node_PSI">
<xs:complexType>
<xs:sequence>
<xs:element name="PRS" sql:relation="PRS"
sql:relationship="PSI_PRS">
<xs:complexType>
<xs:attribute name="apb" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="mtp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pfs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cap" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="tps" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="upb" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="prc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PRS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="PSI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PSI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OPS" sql:relation="OPS" sql:relationship="Node_OPS">
<xs:complexType>
<xs:sequence>
<xs:element name="PSR" sql:relation="PSR"
sql:relationship="OPS_PSR">
<xs:complexType>
<xs:attribute name="PSR_ID" type="xs:integer" use="optional"/>
<xs:attribute name="OPS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="psrc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OPS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="LFS" sql:relation="LFS" sql:relationship="Node_LFS">
<xs:complexType>
<xs:sequence>
<xs:element name="ILF" sql:relation="ILF"
sql:relationship="LFS_ILF">
<xs:complexType>
<xs:sequence>
<xs:element name="LFA" sql:relation="LFA"
sql:relationship="ILF_LFA">
<xs:complexType>
<xs:attribute name="aec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="txt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LFA_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ILF_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="lfp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lfn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ilc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ILF_ID" type="xs:integer" use="optional"/>
<xs:attribute name="LFS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="lsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LFS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="nty" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rdt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="snm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lrd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rtm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="Node_ID" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

BulkLoad in multiple tables - How to write the annotations?

My Problem: I have to import XML-Files into a complex SQlServer-DB (20
Tables,m2n-relations) via XML Bulkload.
The annotations in the Mapping-Scheme looks like:
<sql:relationship name="RLS_LUN" parent="RLS" parent-key="RLS_ID"
child="LUN" child-key="RLS_ID"/>
The elements (tablenames) are annotated with:
<xs:element name="LUN" sql:relation="LUN" sql:relationship="RLS_LUN">
At executing the Script for Bulkload the following error message appears:
Schema: the parent/child table of the relationship on 'DPI' does not match.
Some facts:
The tablefields are attributes.
The tables have IDs as identity-columns (must add them as attribute?)
What and where is the problem?
It would be very nice, if someone could help me, it′s important for me,
thank you in advance
The error you received indicates that the parent and child relations in
your sql:relationship are inconsistent with the relations defined on the
parent and child sides of the relationship.
In addition, the error specifies a relationship not included in your
orginal post (DPI). Posting the entire mapping schema would probably help.
Andrew Conrad
Microsoft Corp
|||Now my updated schema (still not working, but why?!?!?):
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 sp1 U (http://www.xmlspy.com) by Schlagl
Susanne (-) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns:dt="urn:schemas-microsoft-com:datatypes" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:annotation>
<xs:appinfo>
<sql:relationship name="IPI_ISR" parent="IPI" parent-key="IPI_ID"
child="ISR" child-key="IPI_ID"/>
<sql:relationship name="Node_PPI" parent="Node" parent-key="Node_ID"
child="PPI" child-key="Node_ID"/>
<sql:relationship name="PPI_PTT" parent="PPI" parent-key="PPI_ID"
child="PTT" child-key="PPI_ID"/>
<sql:relationship name="PPI_DPT" parent="PPI" parent-key="PPI_ID"
child="DPT" child-key="PPI_ID"/>
<sql:relationship name="Node_ZPI" parent="Node" parent-key="Node_ID"
child="ZPI" child-key="Node_ID"/>
<sql:relationship name="ZPI_DOT" parent="ZPI" parent-key="ZPI_ID"
child="DOT" child-key="ZPI_ID"/>
<sql:relationship name="Node_ORS" parent="Node" parent-key="Node_ID"
child="ORS" child-key="Node_ID"/>
<sql:relationship name="Node_IDS" parent="Node" parent-key="Node_ID"
child="IDS" child-key="Node_ID"/>
<sql:relationship name="IDS_IBS" parent="IDS" parent-key="IDS_ID"
child="IBS" child-key="IDS_ID"/>
<sql:relationship name="Node_RLS" parent="Node" parent-key="Node_ID"
child="RLS" child-key="Node_ID"/>
<sql:relationship name="RLS_LUN" parent="RLS" parent-key="RLS_ID"
child="LUN" child-key="RLS_ID"/>
<sql:relationship name="Node_ORH" parent="Node" parent-key="Node_ID"
child="ORH" child-key="Node_ID"/>
<sql:relationship name="ORH_RHC" parent="ORH" parent-key="ORH_ID"
child="RHC" child-key="ORH_ID"/>
<sql:relationship name="Node_SDS" parent="Node" parent-key="Node_ID"
child="SDS" child-key="Node_ID"/>
<sql:relationship name="Node_ORB" parent="Node" parent-key="Node_ID"
child="ORB" child-key="Node_ID"/>
<sql:relationship name="ORB_RBL" parent="ORB" parent-key="ORB_ID"
child="RBL" child-key="ORB_ID"/>
<sql:relationship name="Node_SST" parent="Node" parent-key="Node_ID"
child="SST" child-key="Node_ID"/>
<sql:relationship name="Node_PSI" parent="Node" parent-key="Node_ID"
child="PSI" child-key="Node_ID"/>
<sql:relationship name="PSI_PRS" parent="PSI" parent-key="PSI_ID"
child="PRS" child-key="PSI_ID"/>
<sql:relationship name="Node_OPS" parent="Node" parent-key="Node_ID"
child="OPS" child-key="Node_ID"/>
<sql:relationship name="OPS_PSR" parent="OPS" parent-key="OPS_ID"
child="PSR" child-key="OPS_ID"/>
<sql:relationship name="Node_LFS" parent="Node" parent-key="Node_ID"
child="LFS" child-key="Node_ID"/>
<sql:relationship name="LFS_ILF" parent="LFS" parent-key="LFS_ID"
child="ILF" child-key="LFS_ID"/>
<sql:relationship name="ILF_LFA" parent="ILF" parent-key="ILF_ID"
child="LFA" child-key="ILF_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:element name="SPR" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="NODE" sql:relation="NODE">
<xs:complexType>
<xs:sequence>
<xs:element name="DPI" sql:relation="DPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="Node" parent-key="Node_ID" child="DPI"
child-key="Node_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="AQS" sql:relation="AQS">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="AQS"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="rqt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rtc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rqs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="AQS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OPI" sql:relation="OPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="OPI"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="did" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="odc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OVE" sql:relation="OVE">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="OVE"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="vid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="vck" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="arn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="vst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="srq" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dck" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OVE_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="TSQ" sql:relation="TSQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="TSQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="xsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsk" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsi" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="TSQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="CPQ" sql:relation="CPQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="CPQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="fci" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="fsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="fps" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="CPQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="WLQ" sql:relation="WLQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="WLQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="wrc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wrt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wrs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="WLQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="BLQ" sql:relation="BLQ">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="BLQ"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="ect" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="bec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="BLQ_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="EXL" sql:relation="EXL">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="DPI" parent-key="DPI_ID" child="EXL"
child-key="DPI_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="nxl" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="EXL_ID" type="xs:integer" use="optional"/>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="DPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
<xs:attribute name="tsqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ovec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="blqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="opic" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dpt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="wlqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="exlc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cpqc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="aqsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
<xs:element name="IPI" sql:relation="IPI">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="Node" parent-key="Node_ID" child="IPI"
child-key="Node_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="ISR" sql:relation="ISR"
sql:relationship="IPI_ISR">
<xs:complexType>
<xs:attribute name="iss" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="itt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ihp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ipu" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="iku" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="itn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ISR_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="iht" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="IPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PPI" sql:relation="PPI" sql:relationship="Node_PPI">
<xs:complexType>
<xs:sequence>
<xs:element name="DPT" sql:relation="DPT"
sql:relationship="PPI_DPT">
<xs:complexType>
<xs:attribute name="lst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="tts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lsp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pok" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="DPT_ID" type="xs:integer" use="optional"/>
<xs:attribute name="PPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PTT" sql:relation="PTT"
sql:relationship="PPI_PTT">
<xs:complexType>
<xs:attribute name="PTT_ID" type="xs:string" use="optional"/>
<xs:attribute name="PPI_ID" type="xs:string" use="optional"/>
<xs:attribute name="xus" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xok" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="xnt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="dkt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ZPI" sql:relation="ZPI" sql:relationship="Node_ZPI">
<xs:complexType>
<xs:sequence>
<xs:element name="DOT" sql:relation="DOT"
sql:relationship="ZPI_DOT">
<xs:complexType>
<xs:attribute name="ook" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ons" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="osp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="onm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sts" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ost" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="DOT_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ZPI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="okt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ZPI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORS" sql:relation="ORS" sql:relationship="Node_ORS">
<xs:complexType>
<xs:sequence>
<xs:element name="ARD" sql:relation="ARD">
<xs:annotation>
<xs:appinfo>
<sql:relationship parent="ORS" parent-key="ORS_ID" child="ARD"
child-key="ORS_ID"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:attribute name="sid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lns" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="mid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lds" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ARD_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ORS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="IDS" sql:relation="IDS" sql:relationship="Node_IDS">
<xs:complexType>
<xs:sequence>
<xs:element name="IBS" sql:relation="IBS"
sql:relationship="IDS_IBS">
<xs:complexType>
<xs:attribute name="bus" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="bkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="IDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IBS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="IDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="IBS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="RLS" sql:relation="RLS" sql:relationship="Node_RLS">
<xs:complexType>
<xs:sequence>
<xs:element name="LUN" sql:relation="LUN"
sql:relationship="RLS_LUN">
<xs:complexType>
<xs:attribute name="lkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LUN_ID" type="xs:integer" use="optional"/>
<xs:attribute name="RLS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="RLS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORH" sql:relation="ORH" sql:relationship="Node_ORH">
<xs:complexType>
<xs:sequence>
<xs:element name="RHC" sql:relation="RHC"
sql:relationship="ORH_RHC">
<xs:complexType>
<xs:attribute name="shn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rst" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="RHC_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORH_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ORH_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="SDS" sql:relation="SDS" sql:relationship="Node_SDS">
<xs:complexType>
<xs:attribute name="ddt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sdc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="dsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sds" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="SDS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ORB" sql:relation="ORB" sql:relationship="Node_ORB">
<xs:complexType>
<xs:sequence>
<xs:element name="RBL" sql:relation="RBL"
sql:relationship="ORB_RBL">
<xs:complexType>
<xs:attribute name="rxd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rmd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rdc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="blc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="RBL_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ORB_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="rbc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ORB_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="SST" sql:relation="SST" sql:relationship="Node_SST">
<xs:complexType>
<xs:attribute name="ssc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="SST_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="PSI" sql:relation="PSI" sql:relationship="Node_PSI">
<xs:complexType>
<xs:sequence>
<xs:element name="PRS" sql:relation="PRS"
sql:relationship="PSI_PRS">
<xs:complexType>
<xs:attribute name="apb" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="mtp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pfs" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="cap" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="tps" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="upb" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="prc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PRS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="PSI_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="PSI_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="OPS" sql:relation="OPS" sql:relationship="Node_OPS">
<xs:complexType>
<xs:sequence>
<xs:element name="PSR" sql:relation="PSR"
sql:relationship="OPS_PSR">
<xs:complexType>
<xs:attribute name="PSR_ID" type="xs:integer" use="optional"/>
<xs:attribute name="OPS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="psrc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pnm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="pkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="psc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="OPS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="LFS" sql:relation="LFS" sql:relationship="Node_LFS">
<xs:complexType>
<xs:sequence>
<xs:element name="ILF" sql:relation="ILF"
sql:relationship="LFS_ILF">
<xs:complexType>
<xs:sequence>
<xs:element name="LFA" sql:relation="LFA"
sql:relationship="ILF_LFA">
<xs:complexType>
<xs:attribute name="aec" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="txt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LFA_ID" type="xs:integer" use="optional"/>
<xs:attribute name="ILF_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="lfp" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lfn" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lkw" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ilc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="ILF_ID" type="xs:integer" use="optional"/>
<xs:attribute name="LFS_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="lsc" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="LFS_ID" type="xs:integer" use="optional"/>
<xs:attribute name="Node_ID" type="xs:integer" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="nty" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rdt" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="sid" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="snm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="lrd" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="rtm" type="xs:string" use="required"
sql:datatype="nvarchar(255)"/>
<xs:attribute name="Node_ID" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>