IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'TOB1' AND SYSOBJECTS.name = 'HYGUVENLIDOGUMSURECI')
ALTER TABLE dbo.HYGUVENLIDOGUMSURECI ADD TOB1 bit not null CONSTRAINT DF_HYGUVENLIDOGUMSURECI_TOB1 DEFAULT 0
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'TOB2' AND SYSOBJECTS.name = 'HYGUVENLIDOGUMSURECI')
ALTER TABLE dbo.HYGUVENLIDOGUMSURECI ADD TOB2 bit not null CONSTRAINT DF_HYGUVENLIDOGUMSURECI_TOB2 DEFAULT 0
go

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'DHSB12' AND SYSOBJECTS.name = 'HYGUVENLIDOGUMSURECI')
ALTER TABLE dbo.HYGUVENLIDOGUMSURECI ADD DHSB12 bit not null CONSTRAINT DF_HYGUVENLIDOGUMSURECI_DHSB12 DEFAULT 0
go


IF  EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'UYGMDLACIKLAMAIZLEMDENGETIR' AND SYSOBJECTS.name = 'HYGUVENLIDOGUMSURECI')
BEGIN
   ALTER TABLE HYGUVENLIDOGUMSURECI
   DROP CONSTRAINT DF_HYGUVENLIDOGUMSURECI_HYGUVENLIDOGUMSURECI;   

   ALTER TABLE dbo.HYGUVENLIDOGUMSURECI
   DROP COLUMN UYGMDLACIKLAMAIZLEMDENGETIR;
END

go