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.
Author |
Topic |
jrockfl
Posting Yak Master
223 Posts |
Posted - 2007-08-13 : 22:38:00
|
I have two tables, I am trying to update tblP to a self joining parent/child relationship and delete tblMa all together.tblMacus_no(parent) cus_no2(child)1 21 31 4tblPcus_no ParentCus_No1 null2 13 14 1 UPDATE tblPSET ParentCus_No = cus_no2FROM tblPoints tblPINNER JOIN tblMultipleAccounts tblMaon tblP.cus_no = tblMa.cus_noIt does update some records, but do not seem correct. Is what I am trying to do possible? I have been looking at this too long. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-08-13 : 23:00:56
|
quote: do not seem correct
Your update query seems fine. What do you mean do not seem correct ? What is not correct ? the update ?quote: I am trying to update tblP to a self joining parent/child relationship and delete tblMa all together
You will also need a DELETE query to delete tblMaDELETE tblMa KH[spoiler]Time is always against us[/spoiler] |
 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2007-08-14 : 06:08:57
|
I spot checked some of the records and some should have had a value for ParentCus_Nobut didn't. I can double check, I just wanted to make sure my query looked fine. Yes, I will need to delete the table once I know the records have been updated correctly. |
 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2007-08-14 : 21:01:24
|
thanks for your help, it was a data issue. |
 |
|
|
|
|