Rona,
What you are really asking is whether or not the sql:relationship element supports
one to many relationships when there is no constraint on the table to enforce that
either defines a primary or foreign key. If you trace a Bulk Load using
sql:relationship, you will see it runs sp_foreign_keys_rowset to determine if there
are such constraints. Simply put, you can do self joins using views and the
sql_relationship without formal keys, but bulk load requires them.
Investigate using XSLT to change the structure and iteratively add attributes with
the parent key information or consider using OPENXML as follows:
DECLARE @idoc int DECLARE @doc varchar(1000) SET @doc ='<topelement> <word
text="ball"> <match matchID="1" /> <match matchID="1234" /> <match matchID="56" />
</word> <word text="puck"> <match matchID="5643" /> </word> </topelement>' --Create
an internal representation of the XML document. EXEC sp_xml_preparedocument @idoc
OUTPUT, @doc -- Execute a SELECT statement that uses the OPENXML rowset provider.
INSERT INTO #temptable
SELECT * FROM OPENXML (@idoc, '/topelement/word/match',8) WITH ( text varchar(10)
'parent::word/@text' , ID int '@matchID' )
EXEC sp_xml_removedocument @idoc
Thank you for your post and I hope you found the information helpful.
Drew Minkin, MCDBA, MCSD, MCSE SQL Support Professional, Microsoft Corporation email:
dminkin@online.microsoft.com
This posting is provide "AS IS" with no warranties, and confers no rights. Please do
not send email directly to this alias. Respond to the newsgroup
For the latest in SQLXML, check out
http://www.microsoft.com/sql/techinfo/xml
Are you secure? For information about the Microsoft Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.