Views:

A client did not use multiple currencies. They originally had setup a USDOLLAR currency ID but did not like it. They asked us to update the label to be the Z-US$ in order to keep the currencies consistent between companies. To do I ran the following script against the company database. I then ran all three MC checklink options. After running the scripts and checklinks I ran the Find Anything in a table script to make sure no where in the database did USDOLLAR exist or 1000 in any currency index fields.

--select * from MC40000
update MC40000 set FUNLCURR='Z-US$', FUNCRIDX='1007'
GO
declare @currid char(100)

declare mc_cursor CURSOR for select 'update ' + o.name + ' set CURRNIDX =''1007'''
from sysobjects o,syscolumns c 
where o.id=c.id and c.name='CURRNIDX' and o.type='U' and
o.name<>'MC00200' and o.name<>'MC00201' and o.name<>'MC40201'
set nocount on
OPEN mc_cursor
FETCH NEXT from mc_cursor into @currid

while (@@FETCH_STATUS <>-1)
begin

exec (@currid)
FETCH NEXT from mc_cursor into @currid

end

DEALLOCATE mc_cursor
GO
----- 
update PM10100 set ICCURRID='Z-US$', ICCURRIX=1007 where ICCURRID<>'Z-US$' or ICCURRIX <>1007
update PM10200 set FROMCURR='Z-US$' where FROMCURR<>'Z-US$' 
update PM20100 set FROMCURR='Z-US$' where FROMCURR<>'Z-US$'
update PM30300 set FROMCURR='Z-US$' where FROMCURR<>'Z-US$'
update PM80600 set ICCURRID='Z-US$', ICCURRIX=1007 where ICCURRID<>'Z-US$' or ICCURRIX <>1007
GO

declare @currid char(100)

declare mc_cursor CURSOR for select 'update ' + o.name + ' set CURNCYID=''Z-US$'''
from sysobjects o,syscolumns c 
where o.id=c.id and c.name='CURNCYID' and o.type='U' and
o.name<>'MC00200' and o.name<>'MC00201' and o.name<>'MC40201'
set nocount on
OPEN mc_cursor
FETCH NEXT from mc_cursor into @currid

while (@@FETCH_STATUS <>-1)
begin

exec (@currid)
FETCH NEXT from mc_cursor into @currid

end

DEALLOCATE mc_cursor