suoirotciv
Programmer
declare @cCustNo as varchar(20), @nType as numeric
declare @vTelNo as numeric
DECLARE RS_cursor CURSOR
FOR
SELECT cCustomerNo, nType FROM Customer_Contact
OPEN RS_cursor
FETCH NEXT FROM RS_cursor INTO @cCustNo, @nType
set @vTelNo = 0
while @@FETCH_STATUS = 0
begin
set @vTelNo = @vTelNo + 1
update Customer_Contact set cTelNo = cast(@vTelNo as varchar(7)) where cCustomerNo = @cCustNo and nType = @nTYpe
FETCH NEXT FROM RS_cursor INTO @cCustNo, @nType
end
close RS_cursor
========================================================
but this will just simply update the value to 1 to end of recordset
i need it to be formatted to "0000001", "0000002" . . . etc . .
could any help me on this please . . .
Please pardon the grammar.
Not good in english.