Mapping schemas for multiple tables

Mapping schemas for multiple tables

Post by RayG » Thu, 27 Jun 2002 02:02:34



Is there a way to create mappings to multiple tables?  For
example, I need ot put all "item" and "description" data
in a table called item (PK is itemNumber).
Then all "styles" get inserted to style table with the
itemNo as a FK.  The same is true for "translations"
and "prices".  they need to be in there own table
witha FK ref to itemNo.

thanks

<ROOT>
        <item number="19999" status="ACTIVE" category="X" >
                <description brand-name="TEST"
image="test.jpg" >
                        <shortDesc>Test</shortDesc>
                        <longDesc>Test Long Desc</longDesc>
                </description>
                <styles>
                        <style style-code="ALD.00.00"  
description="Almond"/>
                        <style style-code="BLK.00.00"  
description="Black"/>
                        <style style-code="BLU.00.00"  
description="Blue"/>
                        <style style-code="GRN.00.00"  
description="Green"/>
                        <style style-code="WHT.00.00"  
description="White"/>
                </styles>
                <translations>
                        <translation provider-item-
number="9181" item-number="14020" style-code="BLU.00.00"/>
                        <translation provider-item-
number="4700" item-number="14020" style-code="BLU.00.00"/>
                        <translation provider-item-
number="9179" item-number="14020" style-code="GRN.00.00"/>
                        <translation provider-item-
number="4698" item-number="14020" style-code="GRN.00.00"/>
                </translations>
                <prices>
                        <price program-name="XYZ"
points="4" billing-price="1.99"/>
                        <price program-name="ABC"
points="5" billing-price="2.99"/>
                        <price program-name="123"
points="6" billing-price="3.99"/>
                </prices>

        </item>
</ROOT>  

 
 
 

Mapping schemas for multiple tables

Post by Bryant Like » Thu, 27 Jun 2002 09:40:42



Quote:> Is there a way to create mappings to multiple tables?

It depends on which direction you're going. If you are using an XSD schema
to create a view of the data in your database, then you can use multiple
tables using the sql:relationship annotation (see the SDK for more info).
However, if you're hoping to import to multiple tables, and your primary key
table is an identity, then you will not be able to insert the correct
foreign key values. Otherwise, it works the same way by using the
sql:relationship.

--
Bryant

 
 
 

Mapping schemas for multiple tables

Post by Greg » Sun, 21 Jul 2002 06:08:43


Hi Bryant,

Could you post a link to the SDK you mentioned in the
post, please? I also have a similar situation when an XML
file needs to be loaded into 5 tables(one main table
Products and 4 other tables are related to the main one)

TIA, Greg

>-----Original Message-----


>> Is there a way to create mappings to multiple tables?

>It depends on which direction you're going. If you are
using an XSD schema
>to create a view of the data in your database, then you
can use multiple
>tables using the sql:relationship annotation (see the SDK
for more info).
>However, if you're hoping to import to multiple tables,

and your primary key
Quote:>table is an identity, then you will not be able to insert
the correct
>foreign key values. Otherwise, it works the same way by
using the
>sql:relationship.

>--
>Bryant

>.

 
 
 

Mapping schemas for multiple tables

Post by Bryant Like » Sun, 21 Jul 2002 07:37:38



Quote:> Hi Bryant,

> Could you post a link to the SDK you mentioned in the
> post, please? I also have a similar situation when an XML
> file needs to be loaded into 5 tables(one main table
> Products and 4 other tables are related to the main one)

http://msdn.microsoft.com/sqlxml

From there click on SQLXML 3.0 sp1 (on the far right). Download and install
this and you can select the documentation only under customer setup.

--
Bryant