
IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'ILACID' AND SYSOBJECTS.name = 'HYATISILACTESLIMALINAN')
ALTER TABLE dbo.HYATISILACTESLIMALINAN ADD
	ILACID int NULL
GO

ALTER TABLE dbo.HYATISILACTESLIMALINAN ALTER COLUMN
	ITEMID int NULL
GO

UPDATE HYATISILACTESLIMALINAN SET HYATISILACTESLIMALINAN.ILACID = TITEM.ILACID FROM HYATISILACTESLIMALINAN LEFT OUTER JOIN 
TITEM ON TITEM.ITEMID = HYATISILACTESLIMALINAN.ITEMID
WHERE HYATISILACTESLIMALINAN.ILACID IS NULL AND TITEM.ILACID IS NOT NULL  