Connecting Tech Pros Worldwide Forums | Help | Site Map

Loop in TSQL

Newbie
 
Join Date: Aug 2005
Posts: 1
#1: Aug 27 '05
Hi!

I'm a newbee in TSQL, so I've a simple question (I think):

I want to make a loop from the first row to the last row in one table.
For each row I want to festch two fields @Customer_number and @Phone.

Then I'll use those values to update a second table:

update samtaler_table set cust_nbr = @custumer_number where (telephone = @phone) and (cust_nbr = 'XXXX')
fetch next


As you see I want to update a row with a cusomer number where there is a dummy value.

Thanks in advance.

Kind regards
Terje

Reply