SET ANSI_NULLS ON
go

SET QUOTED_IDENTIFIER ON
go

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TSORGUPIVOT]') AND type in (N'U'))
BEGIN


CREATE TABLE [dbo].[TSORGUPIVOT](
	[ID] [int] NOT NULL,
	[RAPORADI] [nvarchar](150) NULL,
	[ACIKLAMA] [nvarchar](500) NULL,
	[FORM] [nvarchar](150) NULL,
	[KYTUSER] [nvarchar](50) NULL,
	[KYTTARIHI] [datetime] NULL,
	[PASIF] [bit] NOT NULL,
	[SUBEID] [int] NULL,
	[RAPOR] [varchar](max) NULL,
	[KULLANICIVARSAYILAN] [bit] NULL,
 CONSTRAINT [PK_TSORGUPIVOT] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

END

GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'DF_TSORGUPIVOT_PASIF') AND type in (N'D'))
	ALTER TABLE [dbo].[TSORGUPIVOT] ADD  CONSTRAINT [DF_TSORGUPIVOT_PASIF]  DEFAULT ((0)) FOR [PASIF]

GO

