SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Parent-Child Update Find
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mkdlmr
Starting Member

21 Posts

Posted - 02/25/2014 :  09:27:46  Show Profile  Reply with Quote
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 - 02/25/2014 :  12:32:09  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1600 Posts

Posted - 02/25/2014 :  18:18:09  Show Profile  Reply with Quote
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 - 02/26/2014 :  08:25:31  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000