IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'AKTIF' AND SYSOBJECTS.name = 'TMDLPROVTURU')
ALTER TABLE dbo.TMDLPROVTURU ADD
	AKTIF bit NOT NULL CONSTRAINT DF_TMDLPROVTURU_AKTIF DEFAULT 1,
	PASIFTARIHI smalldatetime NULL
GO

UPDATE TMDLPROVTURU SET AKTIF = 0, PASIFTARIHI = '20170101' WHERE MDLPROVTURUKOD = 'K' AND AKTIF = 1
GO