Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SqlXMLBUlkUpload

Author  Topic 

pelegk2
Aged Yak Warrior

723 Posts

Posted - 2008-07-31 : 04:05:47
in this article there is an exmplae on how to use a schema to upload XML to a db :
[url]http://www.sqljunkies.ddj.com/Article/650DF949-148D-46B3-9156-6783646F976D.scuk[/url]


when i try to do :
xml==>>

<OPEN>
<HEAD>
<SESSION>aaa34
</SESSION>
</HEAD>
</OPEN>

schema==>>

<?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="PALO" sql:is-constant="1">
<element type="HEAD" />
</ElementType>
<ElementType name="SESSION" dt:type="string" />
<ElementType name="HEAD" sql:relation="test" >
<element type="SESSION" sql:field="SESSION" />
</ElementType>
</Schema>

everything work OK!
but when i try to do :

<OPEN>
<HEAD>
<SESSION>aaa34
</SESSION>
</HEAD>
<HEAD2>
<SESSION2>aaa32222
</SESSION2>
</HEAD2>
</OPEN>

schema==>>

<?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="PALO" sql:is-constant="1">
<element type="HEAD" />
<element type="HEAD2" />
</ElementType>
<ElementType name="SESSION" dt:type="string" />
<ElementType name="HEAD" sql:relation="test" >
<element type="SESSION" sql:field="SESSION" />
</ElementType>
<ElementType name="SESSION2" dt:type="string" />
<ElementType name="HEAD2" sql:relation="test" >
<element type="SESSION2" sql:field="SESSION2" />
</ElementType>
</Schema>

in this case i get 2 rows i nthe db,where only the session column gets a value but the session2 column stays empty - why is that?
what is wrong with the schema?

thnaks in advance
peleg

Israel -the best place to live in aftr heaven 9but no one wan't to go there so fast -:)
   

- Advertisement -