IF NOT EXISTS(SELECT Name FROM Sysobjects WHERE Name = 'ClubCreditSetting')
BEGIN
CREATE TABLE [dbo].[ClubCreditSetting](
	[Id] [SMALLINT] IDENTITY(1,1) NOT NULL,
	[StartDate] [SMALLDATETIME] NULL,
	[EndDate] [SMALLDATETIME] NULL,
	[DefinePrice] [MONEY] NULL,
	[Score] [SMALLINT] NULL,
	[ScoreType] [TINYINT] NULL,
	[IsDecimal] [BIT] NULL,
	[IsActive] [BIT] NULL,
	[Percent_Club] [REAL] NULL,
	[FromDay] [SMALLINT] NULL,
	[ToDay] [SMALLINT] NULL,
	[ScorePrice] [MONEY] NULL,
 CONSTRAINT [PK_ClubCreditSetting] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)
) ON [PRIMARY]

ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((1)) FOR [ScoreType]
ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((1)) FOR [IsDecimal]
ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((1)) FOR [IsActive]
ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((0)) FOR [Percent_Club]
ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((0)) FOR [FromDay]
ALTER TABLE [dbo].[ClubCreditSetting] ADD  DEFAULT ((0)) FOR [ToDay]
End

