BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
SQL XML
SQLXML - Mapping .NET Schemas
.NET & OPENXML
.NET Parameterized Templates
SQLXML - Raw mode
SQLXML - FOR XML mode
Automate saving options from ADO into an XML format
Microsoft's dataselect functionality in the XML DSO
VB/ADO to DataIsland
Inserting nodes: String Load or Dom Load?
WebDAVExplorer
XML-based Internet RPC (XIR)
XDO
Translating an ADO recordset's XML to another XML vocab
How to find distinct values from XML (Muenchian Technique)
Converting to DateTime format in SQL
Filtering unique values
Passing stored procedure a list of complete zipcodes to validate
Convert a flat text file into xml
XML IMDB Concepts.
Using XML as a Data Store
<< SEO
System.XML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :275

 

SQLXML - Mapping Relationships To XML

It is very important that we specify all parent-child relationships between the tables and designate key columns in a mapping schema. SQLXML needs this information to be able to create the correct SQL statements when we issue XPath queries and Updategrams. To map a parent-child relationship between XML types to SQL Server tables we first have to add a relationship annotation to the mapping schema. Then we add a reference to this relationship definition to the element where the actual nesting occurs as depicted in the following diagram:

Figure 15.xx: The relationship annotation defines how nested XML types map to database tables and which XML nodes map to primary and foreign key columns.

Note that SQLXML can also handle situations where parent-child relationships between XML elements and SQL Server are opposites of each other. You can add the inverse annotation to the relationship definition and SQLXML will swapping parent and child when transforming XML to data in SQL Server.

Also, note that the key fields referenced in the relationship definition do not need to be part of the XML type definition. SQLXML will automatically generate the foreign key entry in the table identified as the child. Likewise, SQLXML will appropriately generate entries for M:N relationships if they are properly set up in the mapping schema.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C
Immediate ASP.NET/C# Openings for C

View all Jobs (Add yours)
View all CV (Add yours)



efax
swimming pool contractor
reservationless conference calls
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP