Sunday, January 02, 2005

Howto accelerate the SP for the currency conversion

-Export the APRT table to the fastest server.
-Modify the structure of SP currencies conversion as follow :



declare @idtar varchar (20)
declare @Mont int
declare curseur cursor for
select idt_ar, Montant_ar * 1.35
From test where ...
Open curseur
Fetch next from curseur into @idtar, @Mont
While @@fetch_status = 0
Begin
Update test
set Montant_ar = @Mont
where idt_ar = @idtar and ...
Fetch next from curseur into @idtar, @Mont
End
Close curseur
Deallocate curseur


-After the execution of the SP with success, re-export the APRT table back to its server.

No comments: