IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'MDLUYGDRGONDERILSIN' AND SYSOBJECTS.name = 'SUBEBOLUM')
ALTER TABLE SUBEBOLUM ADD
	MDLUYGDRGONDERILSIN bit NULL
GO


UPDATE SUBEBOLUM SET SUBEBOLUM.MDLUYGDRGONDERILSIN = TBOLUM.MDLUYGDRGONDERILSIN FROM TBOLUM 
INNER JOIN SUBEBOLUM ON SUBEBOLUM.BOLUMID = TBOLUM.BOLUMID
WHERE SUBEBOLUM.MDLUYGDRGONDERILSIN IS NULL

