IF NOT EXISTS (SELECT * FROM SYSOBJECTS
              WHERE  SYSOBJECTS.name = 'TDRAMELIYATPAKETAMELIYATLARI')

CREATE TABLE [dbo].[TDRAMELIYATPAKETAMELIYATLARI](
	[DRPAKETAMELIYATID] [int] IDENTITY(1,1) NOT NULL,
	[DRPAKETID] [int] NULL,
	[ITEMID] [int] NOT NULL,
	[TUTAR] [float] NOT NULL,
	[DRID] [int] NULL,
 CONSTRAINT [PK_TDRAMELIYATPAKETAMELIYATLARI] PRIMARY KEY CLUSTERED 
(
	[DRPAKETAMELIYATID] 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 SYSOBJECTS
              WHERE  SYSOBJECTS.name = 'DF_TDRAMELIYATPAKETAMELIYATLARI_TUTAR' AND xtype='D')
ALTER TABLE [dbo].[TDRAMELIYATPAKETAMELIYATLARI] ADD  CONSTRAINT [DF_TDRAMELIYATPAKETAMELIYATLARI_TUTAR]  DEFAULT ((0)) FOR [TUTAR]
GO

