| Author |
Topic |
|
zakyfirdaus
Starting Member
6 Posts |
Posted - 2005-09-13 : 04:41:13
|
| Hi ALL,i have 2 table, first table is CUSTOMER table that have 2 field (id_cust,id_support)second table is SUPPORT table that have 3 field (id_support, support_name,role)CUSTOMER TABLEid_cust id_support3301 03302 03303 03304 03305 03306 0SUPPORT TABLEid_support support_name role011 john 2012 smith 3013 rina 4 i wanna update data from SUPPORT TABLE (id_support) to CUSTOMER TABLE (id_support) incrementally based on id_support using stored procedurecan i get result like this, where id_support insert incrementally..???CUSTOMER TABLEid_cust id_support3301 0113302 0123303 0133304 0113305 0123306 013THANX BEFORE...REGARD ZAC |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-13 : 04:45:49
|
| How do you relate those two tables?What is the logic you used to produce that result?MadhivananFailing to plan is Planning to fail |
 |
|
|
zakyfirdaus
Starting Member
6 Posts |
Posted - 2005-09-13 : 04:50:28
|
| CUSTOMER TABLE id_cust is primary keySUPPORT TABLE id_support is primary keyn there is no relationship between CUSTOMER TABLE n SUPPORT TABLE |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-13 : 04:53:30
|
| >>n there is no relationship between CUSTOMER TABLE n SUPPORT TABLEThen on what basis do you want to update?MadhivananFailing to plan is Planning to fail |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-09-13 : 04:53:43
|
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxunder number 1Go with the flow & have fun! Else fight the flow |
 |
|
|
zakyfirdaus
Starting Member
6 Posts |
Posted - 2005-09-13 : 05:04:19
|
quote: Originally posted by madhivanan >>n there is no relationship between CUSTOMER TABLE n SUPPORT TABLEThen on what basis do you want to update?MadhivananFailing to plan is Planning to fail
if i use relationship where id_support become a foreign key for CUSTOMER TABLE, is there a way??THANX |
 |
|
|
zakyfirdaus
Starting Member
6 Posts |
Posted - 2005-09-13 : 05:05:56
|
quote: Originally posted by spirit1 http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxunder number 1Go with the flow & have fun! Else fight the flow 
thanx bro...now i still try with ur example code |
 |
|
|
zakyfirdaus
Starting Member
6 Posts |
Posted - 2005-09-13 : 05:30:50
|
quote: Originally posted by spirit1 http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspxunder number 1Go with the flow & have fun! Else fight the flow 
ups im so sorry bro...it doesnt work...do you mind if u give me a sample code with my SOURCE TABLE (CUSTOMER TABLE n SUPPORT TABLE)???THANX A LOT... |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-09-13 : 06:06:28
|
well since there's no relationship...maybe it'd be best to use a cursor...Go with the flow & have fun! Else fight the flow |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-09-13 : 06:21:25
|
or you need to make relationship MadhivananFailing to plan is Planning to fail |
 |
|
|
|