Veritabanından Kullanılmayan Firma View ve Tablolarının temizlenmesi

SET NOCOUNT ON
DECLARE @i INT=1
DECLARE @SFRM VARCHAR(3)
DECLARE @EB_OF TABLE (FRMNR VARCHAR(3))
DECLARE @EB_SIL_SORGU TABLE(SN INT,SORGU VARCHAR(MAX))
WHILE @i<1000
BEGIN
IF NOT EXISTS (SELECT NR FROM L_CAPIFIRM WHERE NR=@i)
BEGIN
INSERT INTO @EB_OF (FRMNR) VALUES (RIGHT(('000'+CONVERT(VARCHAR(3),@i)),3))
END
SET @i=@i+1

END
DECLARE CRS_SOR CURSOR FOR
SELECT FRMNR FROM @EB_OF ORDER BY FRMNR
OPEN CRS_SOR
FETCH NEXT FROM CRS_SOR INTO @SFRM
WHILE @@FETCH_STATUS =0
BEGIN
INSERT INTO @EB_SIL_SORGU
SELECT
CASE WHEN TABLE_TYPE='BASE TABLE' THEN 1 ELSE 0 END AS SN,
CASE WHEN TABLE_TYPE='BASE TABLE' THEN 'DROP TABLE '+ TABLE_NAME
WHEN TABLE_TYPE='VIEW' THEN 'DROP VIEW '+ TABLE_NAME END AS SORGU
FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_NAME LIKE '%'+@SFRM+'%' AND (TABLE_NAME LIKE 'L[_]%' OR TABLE_NAME LIKE 'LG[_]%' OR TABLE_NAME LIKE 'LV[_]%')
ORDER BY TABLE_TYPE DESC
FETCH NEXT FROM CRS_SOR INTO @SFRM
END
CLOSE CRS_SOR
DEALLOCATE CRS_SOR
SELECT SORGU FROM @EB_SIL_SORGU ORDER BY SN,SORGU

Cari karttaki Vergi No ve TCKNO daki Enter ve Tab karakterlerini temizlenmesi

UPDATE LG_XXX_CLCARD SET
TAXNR=REPLACE(REPLACE(TAXNR,CHAR(13),''),CHAR(10),''),
TCKNO=REPLACE(REPLACE(TCKNO,CHAR(13),''),CHAR(10),'')
WHERE
TAXNR LIKE '%'+CHAR(10)+'%' OR TAXNR LIKE '%'+CHAR(13)+'%'
OR TCKNO LIKE '%'+CHAR(10)+'%' OR TCKNO LIKE '%'+CHAR(13)+'%'

XXX : Firma numarası

Hesap Planınından Silinmiş Muhasebe Hesaplarının Bağlantı Kodlarının Temizlenmesi

DELETE FROM LG_XXX_CRDACREF
WHERE ACCOUNTREF NOT IN (SELECT LOGICALREF FROM LG_XXX_EMUHACC WITH(NOLOCK))

DELETE FROM LG_XXX_ACCCODES
WHERE ACCOUNTREF NOT IN (SELECT LOGICALREF FROM LG_XXX_EMUHACC WITH(NOLOCK))

XXX : Firma Numarası

SELECT failed because the following SET options have incorrect settin ARITHABORT Hatası Alınıyor.

İşlem öncesi mutlaka yedek aldıktan sonra aşağıdaki sorguyu çalıştırıp işleminizi yeniden deneyiniz.

ALTER DATABASE [XXX]
SET ARITHABORT ON

XXX yerine LOGO veritabanı adı yazılmalıdır.

Muhasebe Hesap Tipi Değiştirme

-- 0: Parasal Olmayan (Borç)
-- 1: Parasal Olmayan (Alacak)
-- 2: Parasal

UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '100%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '101%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '102%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '103%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '108%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '110%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '111%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '112%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '118%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '119%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '120%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '121%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '122%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '124%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '126%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '127%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '128%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '129%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '131%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '132%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '133%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '135%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '136%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '137%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '138%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '139%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '150%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '151%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '152%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '153%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '157%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '158%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '159%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '170%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '171%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '172%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '173%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '174%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '175%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '176%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '177%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '178%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '179%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '180%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '181%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '190%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '191%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '192%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '193%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '195%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '196%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '197%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '198%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '199%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '220%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '221%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '222%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '224%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '226%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '229%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '231%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '232%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '233%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '235%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '236%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '237%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '239%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '240%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '241%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '242%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '243%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '244%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '245%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '246%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '247%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '248%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '249%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '250%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '251%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '252%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '253%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '254%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '255%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '256%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '257%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '258%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '259%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '260%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '261%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '262%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '263%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '264%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '267%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '268%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '269%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '271%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '272%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '277%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '278%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '279%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '280%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '281%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '291%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '292%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '293%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '294%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '295%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '297%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '298%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '299%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '300%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '301%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '302%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '303%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '304%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '305%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '306%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '308%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '309%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '320%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '321%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '322%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '326%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '329%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '331%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '332%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '333%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '335%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '336%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '337%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '340%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '349%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '350%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '351%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '352%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '353%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '354%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '355%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '356%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '357%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '358%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '360%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '361%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '368%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '369%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '370%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '371%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '372%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '373%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '379%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '380%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '381%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '391%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '392%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '393%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '397%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '399%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '400%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '401%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '402%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '405%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '407%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '408%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '409%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '420%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '421%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '422%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '426%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '429%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '431%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '432%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '433%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '436%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '437%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '438%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '440%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '449%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '472%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '479%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '480%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '481%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '492%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '493%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '499%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '500%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '501%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '502%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '503%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '520%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '521%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '522%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '523%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '529%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '540%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '541%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '542%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '548%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '549%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '570%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '580%'
UPDATE LG_FFF_EMUHACC SET MONETARY=1 WHERE CODE LIKE '590%'
UPDATE LG_FFF_EMUHACC SET MONETARY=0 WHERE CODE LIKE '591%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '600%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '601%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '602%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '610%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '611%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '612%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '620%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '621%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '622%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '623%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '630%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '631%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '632%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '640%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '641%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '642%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '643%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '644%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '645%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '646%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '647%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '648%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '649%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '653%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '654%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '655%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '656%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '657%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '658%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '659%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '660%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '661%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '671%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '679%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '680%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '681%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '689%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '690%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '691%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '692%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '697%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '698%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '700%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '701%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '710%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '711%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '712%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '713%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '720%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '721%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '722%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '723%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '730%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '731%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '732%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '733%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '734%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '740%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '741%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '742%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '750%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '751%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '752%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '760%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '761%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '762%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '770%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '771%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '772%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '780%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '781%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '782%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '790%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '791%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '792%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '793%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '794%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '795%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '796%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '797%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '798%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '799%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '800%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '805%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '810%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '830%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '833%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '834%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '835%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '895%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '900%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '901%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '902%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '903%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '904%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '905%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '906%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '907%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '910%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '911%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '912%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '913%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '920%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '921%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '930%'
UPDATE LG_FFF_EMUHACC SET MONETARY=2 WHERE CODE LIKE '931%'