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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 CAN I UPDATE DATA INCREMENTALLY??

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 TABLE
id_cust id_support
3301 0
3302 0
3303 0
3304 0
3305 0
3306 0

SUPPORT TABLE
id_support support_name role
011 john 2
012 smith 3
013 rina 4

i wanna update data from SUPPORT TABLE (id_support) to CUSTOMER TABLE (id_support) incrementally based on id_support using stored procedure
can i get result like this, where id_support insert incrementally..???

CUSTOMER TABLE
id_cust id_support
3301 011
3302 012
3303 013
3304 011
3305 012
3306 013

THANX 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?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

zakyfirdaus
Starting Member

6 Posts

Posted - 2005-09-13 : 04:50:28
CUSTOMER TABLE
id_cust is primary key

SUPPORT TABLE
id_support is primary key

n there is no relationship between CUSTOMER TABLE n SUPPORT TABLE
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-13 : 04:53:30
>>n there is no relationship between CUSTOMER TABLE n SUPPORT TABLE

Then on what basis do you want to update?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-09-13 : 04:53:43
http://weblogs.sqlteam.com/mladenp/archive/2005/08/01/7421.aspx
under number 1

Go with the flow & have fun! Else fight the flow
Go to Top of Page

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 TABLE

Then on what basis do you want to update?

Madhivanan

Failing 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
Go to Top of Page

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.aspx
under number 1

Go with the flow & have fun! Else fight the flow



thanx bro...

now i still try with ur example code
Go to Top of Page

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.aspx
under number 1

Go 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...
Go to Top of Page

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
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-13 : 06:21:25
or you need to make relationship

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -