DECLARE @FATID INT = (SELECT MIN(FATID)-1 FROM FATURA WHERE KYTARIH>(CONVERT(VARCHAR,YEAR(DATEADD(MONTH,-2,GETDATE()))) + '-' + RIGHT('0'+CONVERT(VARCHAR,MONTH(DATEADD(MONTH,-2,GETDATE()))),2) + '-01'))
UPDATE FATISL SET DOVIZ=ISNULL(DOVIZKODU,'TL') WHERE (DOVIZ IS NULL) OR (DOVIZ <> DOVIZKODU) AND FATID>@FATID