IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSOBJECTS.name = 'TODEMEGIDERGRUP')

CREATE TABLE [dbo].[TODEMEGIDERGRUP](
	[GRUPID] [int] IDENTITY(1,1) NOT NULL,
	[GRUPACIKLAMA] [nvarchar](150) NULL,
	[PASIF] [bit] NULL,
	[KYTKULLANICI] [nvarchar](30) NULL,
	[KYTTARIHI] [datetime] NULL,
	[SGKULLANICI] [nvarchar](30) NULL,
	[SGTARIHI] [datetime] NULL,
 CONSTRAINT [PK_TODEMEGIDERGRUP] PRIMARY KEY CLUSTERED 
(
	[GRUPID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO


IF NOT EXISTS (SELECT * FROM  SYSOBJECTS 
              WHERE SYSOBJECTS.name = 'DF_TODEMEGIDERGRUP_PASIF')
ALTER TABLE [dbo].[TODEMEGIDERGRUP] ADD  CONSTRAINT [DF_TODEMEGIDERGRUP_PASIF]  DEFAULT ((0)) FOR [PASIF]
GO


