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

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

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

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

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

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

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'KISONCESIONLEM_K7' AND SYSOBJECTS.name = 'HYATISKISITLAMA')
ALTER TABLE dbo.HYATISKISITLAMA ADD	KISONCESIONLEM_K7 [bit] NOT NULL DEFAULT ((0))
GO
/*KISILAMA NEDENLERİ*/

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

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

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

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

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

/*KISILAMA BÖLGESİ*/

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

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

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

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

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

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

/**/


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


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

/*KISITLAMA KALDIRMA KRİTERLERİ*/

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

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

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

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

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

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