IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HYSIVITAKIPDETAY]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HYSIVITAKIPDETAY](
	[SIVITAKIPDETAYID] [int] NOT NULL,
	[SIVITAKIPID] [int] NULL,
	[SAAT] [datetime] NULL,
	[ALDIGISIVIORAL] [float] NULL,
	[ALDIGISIVIADI] [nvarchar](30) NULL,
	[ALDIGISIVITOPMIKTAR] [float] NULL,
	[ALDIGISIVIGIDENMIKTAR] [float] NULL,
	[CIKARDIGISIVIIDRAR] [float] NULL,
	[CIKARDIGISIVIDREN] [float] NULL,
	[CIKARDIGISIVING] [float] NULL,
	[CIKARDIGISIVIDIGER] [float] NULL,
	[SPID] [int] NULL,
 CONSTRAINT [PK_HYSIVITAKIPDETAY] PRIMARY KEY CLUSTERED 
(
	[SIVITAKIPDETAYID] 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 sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HYSIVITAKIP]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[HYSIVITAKIP](
	[SIVITAKIPID] [int] NOT NULL,
	[HYATISID] [int] NULL,
	[TARIH] [datetime] NULL,
	[KYTTARIHI] [datetime] NULL,
	[KYTKULLANICI] [nvarchar](30) NULL,
 CONSTRAINT [PK_HYSIVITAKIP] PRIMARY KEY CLUSTERED 
(
	[SIVITAKIPID] 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 sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[HYSIVITAKIP]') AND 
name = N'IX_HYSIVITAKIP_HYATISID')

CREATE NONCLUSTERED INDEX [IX_HYSIVITAKIP_HYATISID] ON [dbo].[HYSIVITAKIP]
(
	[HYATISID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
GO

