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


CREATE TABLE [dbo].[TODEMEGIDERDETAY](
	[GIDERID] [int] IDENTITY(1,1) NOT NULL,
	[GIDERGRUPID] [int] NULL,
	[GIDERACIKLAMA] [nvarchar](150) NULL,
	[PASIF] [bit] NULL,
	[DRID] [int] NULL,
	[KYTKULLANICI] [nvarchar](30) NULL,
	[KYTTARIHI] [datetime] NULL,
	[SGKULLANICI] [nvarchar](30) NULL,
	[SGTARIHI] [datetime] NULL,
 CONSTRAINT [PK_TODEMEGIDERDETAY] PRIMARY KEY CLUSTERED 
(
	[GIDERID] 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 = 'TODEMEGIDERDETAY')
ALTER TABLE [dbo].[TODEMEGIDERDETAY] ADD  CONSTRAINT [DF_TODEMEGIDERDETAY_PASIF]  DEFAULT ((0)) FOR [PASIF]
GO


