IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'ONAYLANDI' AND SYSOBJECTS.name = 'MUH_SATINALMA_ANLASMA')
ALTER TABLE dbo.[MUH_SATINALMA_ANLASMA] ADD ONAYLANDI bit NOT NULL CONSTRAINT [DF_MUH_SATINALMA_ANLASMA_ONAYLANDI] DEFAULT (0)
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'ONAYKULLANICI' AND SYSOBJECTS.name = 'MUH_SATINALMA_ANLASMA')
ALTER TABLE dbo.[MUH_SATINALMA_ANLASMA] ADD ONAYKULLANICI NVARCHAR(15) null
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
             WHERE SYSCOLUMNS.NAME = 'ONAYZAMANI' AND SYSOBJECTS.name = 'MUH_SATINALMA_ANLASMA')
ALTER TABLE dbo.[MUH_SATINALMA_ANLASMA] ADD ONAYZAMANI datetime  NULL 
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'ONAYDURUMID' AND SYSOBJECTS.name = 'MUH_SATINALMA_ANLASMA')
ALTER TABLE dbo.[MUH_SATINALMA_ANLASMA] ADD ONAYDURUMID int null
GO

