Re: SQLXML sp2 Identity Propagation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Irwin Dolobowsky [MS] (irwind_at_mail.microsoft.com)
Date: 05/07/04


Date: Fri, 7 May 2004 13:27:36 -0700

I"ve asked some folks to take a look, I'll try and get you an answer as soon
as I can.

Irwin

-- 
Irwin Dolobowsky
Program Manager - SqlXml
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian Millard" <bsmillard@tva.gov> wrote in message 
news:enxhYusMEHA.2824@TK2MSFTNGP10.phx.gbl...
> For this example, I have three tables involved, in hierarchical order:
> Parent, Child, and GrandChild.  On each, there is a column ExportSeq.
> On Parent, this column is an Identity and Primary Key.  On Child,
> ExportSeq is a Foreign Key to Parent on ExportSeq, but not an identity.
> On GrandChild, I would like to make ExportSeq a Foreign Key to Child,
> but that requires that ExportSeq on Child to be the Primary Key, and my
> data fails that uniqueness test (additional columns are required for
> uniqueness beginning at the Child level).  How can I propagate the
> identity value first generated for the Parent table down through Child
> to GrandChild?
>
> Here are my XML schema realationships:
>
> <sql:relationship name="Parent-Child"
>    parent="Parent"
>    parent-key="ExportSeq"
>    child="Child"
>    child-key="ExportSeq"  />
>
> <sql:relationship name="Child-GrandChild"
>       parent="Child"
>       parent-key="ExportSeq"
>       child="GrandChild"
>       child-key="ExportSeq" />
>
> I think the problem is with the treatment of ExportSeq on the Child
> table - in order for GrandChild to use ExportSeq as a Foreign Key to
> Child, ExportSeq on Child must be Primary Key, or at least unique, which
> is not the case because of the Foreign Key relation from Child back to
> Parent.  I just want to propagate ExportSeq downward through the entire
> data model as a Foreign Key, without designating ExportSeq as the one
> and only Primary Key at each subsequent level.
>
> Thanks for your time.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it! 


Relevant Pages

  • Re: Foreign key question
    ... then the children have two foreign key fields relating ... But each parent will also have only one first child, ... Eg you have a table of planes and a table of propeller types. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Cascading updates and NULL
    ... foreign key references between the parent and the child and use cascading ... a parent and a child. ... >> DataCol into the child table, cascading updates work fine. ...
    (microsoft.public.sqlserver.programming)
  • Re: deleting a row potentially referenced by many rows in another table
    ... you would use ON DELETE CASCADE on a foreign key in a child table to ... FOREIGN KEY REFERENCES Parent ... row in the child table referencing that (parent) row is deleted (N:1 ...
    (comp.databases.theory)
  • Re: SQLXML sp2 Identity Propagation
    ... Parent, Child, and GrandChild. ... On Parent, this column is an Identity and Primary Key. ... ExportSeq is a Foreign Key to Parent on ExportSeq, ...
    (microsoft.public.sqlserver.xml)
  • Re: Send Strongly-typed Dataset with Multiple Tables to SQL Server
    ... Parent table, but I can't get it to work for children. ... as with Mark was adding the child records. ... INSERT statement conflicted with COLUMN FOREIGN KEY constraint ...
    (microsoft.public.dotnet.languages.vb)