SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TKLINIKKALITE]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[TKLINIKKALITE](
	[KLINIKKALITEKOD] [int] NOT NULL,
	[KLINIKKALITEADI] [nvarchar](300) NULL,
	[AKTIF] [bit] NOT NULL,
	[REFERANSVERI] [nvarchar](500) NULL,
	[OLUSTURMATARIHI] [datetime] NULL,
	[GUNCELLEMETARIHI] [datetime] NULL,
 CONSTRAINT [PK_TKLINIKKALITE] PRIMARY KEY CLUSTERED 
(
	[KLINIKKALITEKOD] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO

IF NOT EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[DF_TKLINIKKALITE_AKTIF]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[TKLINIKKALITE] ADD  CONSTRAINT [DF_TKLINIKKALITE_AKTIF]  DEFAULT ((1)) FOR [AKTIF]
END

GO


