Home All Groups Group Topic Archive Search About

instert into a table recursively

Author
19 May 2006 7:09 AM
bonk
I have a Table that contains Items of the Type "Step". The primary key
is "StepID".  Each step can have have a target step, wich represents a
subsequent step. So I have a Foreign key relationship within the same
table:

Primary Key: StepID --> Foreign Key: TargetStepID

Now if I want to insert a group of new Steps into the table, I can only
insert steps whose target step is already insterted to the table. How
would I solve this problem ? Do I need to write my own client side (I
am using ADO.NET 1.1 / C#  / MS SQL 2000) that loops through the
targetsteps and inserts the targetsteps first ? Or is there a more
celver way to do this ?

AddThis Social Bookmark Button