SQL XML Bulk Load, Relationships and composite keys

by Allan Svelmøe Hansen April 14, 2010 10:31

A little quick note, when needing composite keys in your relationship in SQL XML Bulk Load the syntax is as follow:

<sql:relationship name="Detail"
                  parent
=
"Import.Product"
                  parent
-KEY=
"ProductID FileID"
                  child
=
"Import.ProductDetails"
                  child
-KEY="ProductID FileID"/>
  


meaning they’re simply space separated in the relationship annotation. The composite key in this aspect are the columns ProductID and FileID.
As can also be seen in this annotation, I'm using a schema qualifiaction with Import, so if you have other schemas, you can simply write them in the parent/child.

For more syntax, please refer to the blog post SQL XML Bulk Load - basic XSD syntax

Bookmark and Share DotnetKicks dotnetshoutout

Comments

4/17/2010 1:43:09 PM #

SQL XML Bulk Load - more XSD syntax

SQL XML Bulk Load - more XSD syntax

SQLStuff.dk

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.6.1.0
Theme by Mads Kristensen | Modified by Mooglegiant

About:
Allan Svelmøe Hansen

My real name is Allan Svelmøe Hansen.
I live in Denmark, where I work as a developer for hedal:kruse:brohus using SQL Server and the .NET framework since 2004.
My primary fields of expertise is back-end data integration, database design and optimization.


       View Allan Svelmøe Hansen's profile on LinkedIn     

Disclaimer

The opinions expressed herein are my own personal opinions and thoughts and does not represent my employers view in any way, nor are my results guaranteed for all situations.
Content is presented "as is", with no warranty.