IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'MAXSMSZAMANI' AND SYSOBJECTS.name = 'TDRKIMLIK')
ALTER TABLE TDRKIMLIK ADD MAXSMSZAMANI DATETIME NULL


go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'MAXSMSZAMANIAKTIF' AND SYSOBJECTS.name = 'TDRKIMLIK')
ALTER TABLE TDRKIMLIK ADD MAXSMSZAMANIAKTIF bit not null CONSTRAINT DF_TDRKIMLIK_MAXSMSZAMANIAKTIF DEFAULT 0


go


