Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Parent-Child Update Find

Author  Topic 

mkdlmr
Starting Member

21 Posts

Posted - 2014-02-25 : 09:27:46
Hi All,

I have the following three alphanumeric columns in my table:

Organization_ID (Unique)
Parent_ID
Child_ID

The Child_ID is comma delimited, so a parent can have multiple children.

I'm trying to make it so that when a User updates the Organization_ID it will update in the Parent_ID and Child_ID. I'm fine with these being two separate Update commands. Also can you please tell me how can I report orphaned units as well?

Thanks,
MK

mkdlmr
Starting Member

21 Posts

Posted - 2014-02-25 : 12:32:09
To clarify the User would only be updating the Organization_ID. It should then push to either the Parent_ID and/or Child_ID
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-02-25 : 18:18:09
Update the Parent_ID or Child_ID with what? If the Organization_ID changes, how does that impact either of the other columns?

===============================================================================
There are two kinds of light -- the glow that illuminates, and the glare that obscures. -James Thurber (1894-1961)
Go to Top of Page

mkdlmr
Starting Member

21 Posts

Posted - 2014-02-26 : 08:25:31
Thanks for the reply. I just realized that the Child update portion won't work because there are multiple values.

Basically when a User update Organization_ID I want to run an Update Command that Updates the Parent_ID value of all of its children since, in this case, the Organization_ID and Parent_ID should remain the same.

Thanks,
MK
Go to Top of Page
   

- Advertisement -