IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSOBJECTS.name = 'MDLHRAPORILACILAVEDEGER')
			  
CREATE TABLE [dbo].[MDLHRAPORILACILAVEDEGER](
	[MDLHRAPORILACILAVEDEGERID] [int] NOT NULL,
	[HRAPORID] [int] NOT NULL,
	[ILAVEDEGERTURUID] int NULL,
	[ILAVEDEGERKILO] float NULL,
	[ILAVEDEGERHEMOGLOBIN] float NULL,
	[ILAVEDEGERKANSEKERI] float NULL,
	[ACIKLAMA1] [nvarchar](200) NULL,
	[ACIKLAMA2] [nvarchar](200) NULL,
	[GONDERILDI] [bit] NOT NULL,
 CONSTRAINT [PK_MDLHRAPORILACILAVEDEGER] PRIMARY KEY CLUSTERED 
(
	[MDLHRAPORILACILAVEDEGERID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 70) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[MDLHRAPORILACILAVEDEGER] ADD  CONSTRAINT [DF_MDLHRAPORILACILAVEDEGER_GONDERILDI]  DEFAULT ((1)) FOR [GONDERILDI]
GO

ALTER TABLE [dbo].[MDLHRAPORILACILAVEDEGER]  WITH CHECK ADD  CONSTRAINT [FK_MDLHRAPORILACILAVEDEGER_HRAPOR] FOREIGN KEY([HRAPORID])
REFERENCES [dbo].[HRAPOR] ([HRAPORID])
GO

ALTER TABLE [dbo].[MDLHRAPORILACILAVEDEGER] CHECK CONSTRAINT [FK_MDLHRAPORILACILAVEDEGER_HRAPOR]
GO


