SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HTEDAVITABELAOLCUMKULLANIM]') AND type in (N'U'))

CREATE TABLE [dbo].[HTEDAVITABELAOLCUMKULLANIM](
	[HTEDAVITABELAOLCUMKULLANIMID] [int] IDENTITY(1,1) NOT NULL,
	[HTEDAVITABELAOLCUMID] [int] NULL,
	[PLANLANANTARIH] [datetime] NULL,
	[UYGULANANTARIH] [datetime] NULL,
	[UYGULANDI] [bit] NULL,
	[UYGULANDINOT] [nvarchar](200) NULL,
	[SPID] [int] NULL,
	[DRID] [int] NULL,
	[YOLCUMID] [int] NULL,
	[UYGKYTTRH] [datetime] NULL,
    [DEGER] numeric(10,3) null,   
 CONSTRAINT [PK_HTEDAVITABELAOLCUMKULLANIM] PRIMARY KEY CLUSTERED 
(
	[HTEDAVITABELAOLCUMKULLANIMID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'DEGER' AND SYSOBJECTS.name = 'HTEDAVITABELAOLCUMKULLANIM')
ALTER TABLE HTEDAVITABELAOLCUMKULLANIM 
	ADD DEGER numeric(10,3) NULL
GO	
