ALTER TABLE TITEM ALTER COLUMN BIRIM NVARCHAR(150) NULL
GO

UPDATE TITEM SET BIRIM = TILAC.AMBALAJB
--SELECT    TITEM.KUTUICIADET, TILAC.AMBALAJB, *
FROM         TILAC INNER JOIN
                      TITEM ON TILAC.ILACID = TITEM.ILACID 
                      AND ISNULL(TITEM.BIRIM, '') = '' AND TILAC.AMBALAJB <> '' 
                      AND TITEM.KUTUICIADET = TILAC.AMBALAJ
                      AND NOT (AMBALAJ = 1 AND (AMBALAJB IN ('ML', 'MG', 'GR'))) 
                      
UPDATE TITEM SET BIRIM = TILAC.AMBALAJB
--SELECT    TITEM.KUTUICIADET, TILAC.FORM, *
FROM         TILAC INNER JOIN
                      TITEM ON TILAC.ILACID = TITEM.ILACID AND ISNULL(TITEM.BIRIM, '') = '' AND TILAC.AMBALAJB <> '' AND TITEM.KUTUICIADET = TILAC.AMBALAJ
                      AND (AMBALAJ = 1 AND (AMBALAJB IN ('ML', 'MG', 'GR')))  AND FORM LIKE 'FLAKON%'                    