/****** 对象:  Table [dbo].[ActCat]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ActCat](
	[ActCatID] [int] NOT NULL,
	[CatName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ActivityID] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ActCatProduct]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ActCatProduct](
	[ActCatProID] [int] NOT NULL,
	[ActCatID] [int] NULL,
	[ProductID] [int] NULL,
	[Sort] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Activity]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Activity](
	[ActivityID] [int] NOT NULL,
	[CategoryID] [int] NOT NULL,
	[BrandID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AD] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NOT NULL,
	[Type] [int] NOT NULL,
	[AddTime] [datetime] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[AD]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AD](
	[ADID] [int] NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ADWidth] [int] NOT NULL,
	[ADHight] [int] NOT NULL,
	[ADTop] [int] NOT NULL,
	[ADLeft] [int] NOT NULL,
	[IsOpen] [tinyint] NOT NULL,
	[AdType] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ADCategory]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ADCategory](
	[ADCategoryID] [int] NOT NULL,
	[ADCategoryName] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ADCategoryDesc] [varchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ADType] [int] NOT NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Admin]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Admin](
	[AdminID] [int] IDENTITY(1,1) NOT NULL,
	[AdminName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Password] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Flag] [int] NULL,
	[RealName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[RoleID] [int] NULL CONSTRAINT [DF_Admin_RoleID]  DEFAULT ((-1)),
	[LoginTimes] [int] NULL CONSTRAINT [DF_Admin_LoginTimes]  DEFAULT ((0)),
	[LastLogin] [datetime] NULL,
	[Status] [int] NULL CONSTRAINT [DF_Admin_Status]  DEFAULT ((1)),
 CONSTRAINT [PK_Admin] PRIMARY KEY CLUSTERED 
(
	[AdminID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'真实姓名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Admin', @level2type=N'COLUMN', @level2name=N'RealName'

GO
/****** 对象:  Table [dbo].[AdvancePayment]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdvancePayment](
	[AdvancePaymentID] [int] IDENTITY(1,1) NOT NULL,
	[MemberID] [int] NOT NULL,
	[AdvancePayment] [decimal](19, 2) NOT NULL,
	[Balance] [decimal](18, 2) NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[WorkPeople] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_AdvancePayment_AddTime]  DEFAULT (getdate()),
	[auditor] [int] NULL,
	[auditorname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[audittime] [datetime] NULL,
 CONSTRAINT [PK_AdvancePayment] PRIMARY KEY CLUSTERED 
(
	[AdvancePaymentID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AdvNotify]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AdvNotify](
	[AdvNotifyID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[PayerBank] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayerAccount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayerName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverBank] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverAccount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayTime] [smalldatetime] NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[Attach] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NOT NULL,
	[IsDelete] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[AgencyDrawing]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AgencyDrawing](
	[AgencyDrawingID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[DrawFinance] [decimal](18, 2) NOT NULL,
	[Balance] [decimal](18, 2) NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[DisposeTime] [datetime] NOT NULL,
	[Remark] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[AgencyFinance]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AgencyFinance](
	[AgencyFinanceID] [int] NOT NULL,
	[PeriodNum] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[StartTime] [smalldatetime] NOT NULL,
	[EndTime] [smalldatetime] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Finance] [decimal](18, 2) NOT NULL,
	[Rate] [decimal](18, 3) NOT NULL,
	[Balance] [decimal](18, 2) NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[Remark] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Agent]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Agent](
	[AgentID] [int] IDENTITY(1,1) NOT NULL,
	[LevelID] [int] NULL,
	[MemberID] [int] NULL,
	[AgentName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AgentPhone] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AgentMobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AgentEmail] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Agent_Url]  DEFAULT (''),
	[AgentAddress] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Agent_TotalMoney]  DEFAULT ((0)),
	[AgentQQ] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AgentMsn] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[IDCartNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CompanyName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Postalcode] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteUrl] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteType] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteAbstruct] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BankName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AccountName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BankAccount] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[JumpUrl] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
 CONSTRAINT [PK_Agent] PRIMARY KEY CLUSTERED 
(
	[AgentID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'销售总额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Agent', @level2type=N'COLUMN', @level2name=N'AgentAddress'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态，-1：冻结；0：未审核；1:已审核' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Agent', @level2type=N'COLUMN', @level2name=N'Status'

GO
/****** 对象:  Table [dbo].[AgentCatRatio]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AgentCatRatio](
	[RID] [int] IDENTITY(1,1) NOT NULL,
	[LevelID] [int] NULL,
	[CategoryID] [int] NULL,
	[CategoryNo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Ratio] [decimal](18, 3) NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AgentDiscount]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AgentDiscount](
	[AgentDiscountID] [int] NOT NULL,
	[AgentDis] [decimal](18, 2) NOT NULL,
	[AgentLower] [decimal](18, 2) NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[AgentDrawing]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AgentDrawing](
	[DrawingID] [int] IDENTITY(1,1) NOT NULL,
	[AgentID] [int] NULL,
	[MemberID] [int] NULL,
	[DrawFinance] [decimal](18, 2) NULL,
	[Status] [int] NULL,
	[AppTime] [datetime] NULL,
	[DrawTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
 CONSTRAINT [PK_AgentDrawing] PRIMARY KEY CLUSTERED 
(
	[DrawingID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AgentFinance]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AgentFinance](
	[FID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NULL,
	[OrderNo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderTime] [datetime] NULL,
	[OrderPrice] [decimal](18, 2) NULL,
	[AgentID] [int] NULL,
	[MemberID] [int] NULL,
	[Finance] [decimal](18, 2) NULL,
	[Issue] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Remark] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[AddTime] [datetime] NULL,
	[PayTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
 CONSTRAINT [PK_AgentFinance] PRIMARY KEY CLUSTERED 
(
	[FID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提成金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AgentFinance', @level2type=N'COLUMN', @level2name=N'Finance'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:-1：无须结款；0：不可结款；1：未结款；2：待结款；3：结款中；4：已结款' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AgentFinance', @level2type=N'COLUMN', @level2name=N'Status'

GO
/****** 对象:  Table [dbo].[AgentLevel]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AgentLevel](
	[LevelID] [int] IDENTITY(1,1) NOT NULL,
	[LevelName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[LevelMoney] [decimal](18, 2) NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'升级所需要的发展会员消费金额累积的达标金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AgentLevel', @level2type=N'COLUMN', @level2name=N'LevelMoney'

GO
/****** 对象:  Table [dbo].[AgentPay]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AgentPay](
	[AgentPayID] [int] IDENTITY(1,1) NOT NULL,
	[AgentID] [int] NULL,
	[MemberID] [int] NULL,
	[Finance] [decimal](18, 2) NULL,
	[Issue] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PayTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
 CONSTRAINT [PK_AgentPay] PRIMARY KEY CLUSTERED 
(
	[AgentPayID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AppForm]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AppForm](
	[aid] [int] IDENTITY(1,1) NOT NULL,
	[ano] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[orderid] [int] NULL,
	[orderno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NULL,
	[applicant] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[mobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[refundtype] [tinyint] NULL,
	[type] [int] NULL,
	[reason] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[DeductMoney] [decimal](18, 2) NULL,
	[refundmoney] [decimal](18, 2) NULL,
	[BankName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BankAccount] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AccountName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[receiverphone] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[receiverpostalcode] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[receiveraddress] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[isconfirm] [int] NULL,
	[confirmtime] [datetime] NULL,
	[isreturn] [bit] NULL,
	[returntime] [datetime] NULL,
	[returnconfirm] [bit] NULL,
	[checkconfirm] [int] NULL,
	[checktime] [datetime] NULL,
	[issend] [bit] NULL,
	[sendtime] [datetime] NULL,
	[sendconfirm] [bit] NULL,
	[canrefund] [bit] NULL,
	[isrefunded] [bit] NULL,
	[refundtime] [datetime] NULL,
	[iscompleted] [int] NULL,
	[adduser] [int] NULL,
	[addusername] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL,
 CONSTRAINT [PK_AppForm] PRIMARY KEY CLUSTERED 
(
	[aid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'申请号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'ano'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'退款方式：1退款至商城账户余额；2退款至银行账号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'refundtype'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1:退货;2:换货;3:返修' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'type'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'退货扣除金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'DeductMoney'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'-1:审核不通过;0:等待审核:1:审核通过;2:退款成功' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'isconfirm'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户是否返还货物' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'isreturn'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户返还货物确认' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'returnconfirm'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家检查寄回的货物是否符合退换返的条件' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'checkconfirm'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家是否发回货物' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'issend'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家发回货物确认' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'sendconfirm'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否可以退款' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'AppForm', @level2type=N'COLUMN', @level2name=N'canrefund'

GO
/****** 对象:  Table [dbo].[AppOpLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AppOpLog](
	[aid] [int] NULL,
	[ano] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[operator] [int] NULL,
	[operatorname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[oprule] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[opdesc] [varchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[optime] [datetime] NULL,
	[Remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AppPdt]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AppPdt](
	[aid] [int] NULL,
	[ano] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[productid] [int] NULL,
	[productno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[goodsid] [int] NULL,
	[goodsname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[quantity] [int] NULL,
	[price] [decimal](18, 2) NULL,
	[pmtinfo] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[giftinfo] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AppRefund]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AppRefund](
	[rid] [int] IDENTITY(1,1) NOT NULL,
	[aid] [int] NULL,
	[ano] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[orderid] [int] NULL,
	[orderno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[refundtype] [int] NULL,
	[money] [decimal](18, 2) NULL,
	[bankname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[bankaccount] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[accountname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NULL,
	[realname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[mobile] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[isconfirm] [int] NULL,
	[confirmtime] [datetime] NULL,
	[isrefunded] [bit] NULL,
	[refundtime] [datetime] NULL,
	[addtime] [datetime] NULL,
 CONSTRAINT [PK_AppRefund] PRIMARY KEY CLUSTERED 
(
	[rid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[AppShipping]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AppShipping](
	[aid] [int] NULL,
	[ano] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[shippname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[shippno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[shipptime] [datetime] NULL,
	[shiptype] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[shippprice] [decimal](18, 2) NULL,
	[sendername] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[senderphone] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SenderPostalcode] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[senderaddress] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[receivername] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[receiverphone] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[receiverpostalcode] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[receiveraddress] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Article]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Article](
	[ArticleID] [int] NOT NULL,
	[Title] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ArticleCategoryID] [int] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[Sort] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ArticleCategory]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ArticleCategory](
	[ArticleCategoryID] [int] NOT NULL,
	[CategoryName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CategoryType] [int] NOT NULL,
	[Url] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[NewWindow] [tinyint] NOT NULL,
	[Meta] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CategoryAD] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Number] [int] NOT NULL,
	[Sort] [int] NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[backlist]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[backlist](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[intime] [smalldatetime] NULL,
	[mobno] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[msg] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[userid] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[pwd] [nvarchar](6) COLLATE Chinese_PRC_CI_AS NULL,
	[state] [smallint] NULL,
 CONSTRAINT [PK_backlist] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Bank]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Bank](
	[BankID] [int] IDENTITY(1,1) NOT NULL,
	[BankName] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[SupportFQ] [bit] NULL CONSTRAINT [DF_Bank_SupportFQ]  DEFAULT ((0)),
	[Status] [int] NULL,
	[AddTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
 CONSTRAINT [PK_Bank] PRIMARY KEY CLUSTERED 
(
	[BankID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[BankFQ]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BankFQ](
	[BankID] [int] NOT NULL,
	[Periods] [int] NOT NULL,
	[Rate] [decimal](18, 5) NULL,
	[Min] [decimal](18, 2) NULL,
	[Max] [decimal](18, 2) NULL,
	[Status] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Brand]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Brand](
	[BrandID] [int] NOT NULL,
	[BrandName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Logo] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Sort] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[Hit] [int] NOT NULL,
	[AfterService] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ActID] [int] NOT NULL,
	[AD] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF__Brand__AD__7ADCFAB5]  DEFAULT (''),
 CONSTRAINT [PK_Brand] PRIMARY KEY CLUSTERED 
(
	[BrandID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Bulletin]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Bulletin](
	[BulletinID] [int] NOT NULL,
	[Title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NULL,
	[AddTime] [smalldatetime] NULL,
	[EndTime] [smalldatetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[BuyLimit]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BuyLimit](
	[BuyLimitID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[LimitPrice] [decimal](18, 2) NOT NULL,
	[StartTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Quantity] [int] NOT NULL CONSTRAINT [DF_BuyLimit_Quantity]  DEFAULT ((10)),
	[CategoryID] [int] NOT NULL CONSTRAINT [DF_BuyLimit_CategoryID]  DEFAULT ((1)),
 CONSTRAINT [PK_BuyLimit] PRIMARY KEY CLUSTERED 
(
	[BuyLimitID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[BuyRecored]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BuyRecored](
	[BuyRecoredID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NOT NULL,
	[PdtID] [int] NOT NULL,
	[PdtName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Quantity] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Address] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Phone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyTime] [datetime] NOT NULL,
	[Type] [tinyint] NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Card]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Card](
	[CardID] [int] NOT NULL,
	[CardNo] [numeric](18, 0) NULL,
	[PassWord] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AgentMemberID] [int] NOT NULL,
	[CreateDate] [datetime] NULL,
	[ExpireDate] [datetime] NULL,
	[ActiveDate] [datetime] NULL,
	[Score] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Spending] [decimal](18, 0) NOT NULL,
	[Period] [nvarchar](15) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NULL,
	[GroupID] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[CardContent]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CardContent](
	[CardContentID] [int] NOT NULL,
	[Account] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Pass] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [smalldatetime] NULL,
	[IsSold] [tinyint] NOT NULL,
	[SaleTime] [smalldatetime] NULL,
	[OrderID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[MemberID] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Catalogue]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Catalogue](
	[CatalogueID] [int] NOT NULL,
	[VersionName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CategoryIDs] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Address] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[PostCode] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Mobile] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Tel] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Remark] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[AddTime] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[CatalogueVersion]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CatalogueVersion](
	[CatalogueVersionID] [int] NOT NULL,
	[VersionName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[CatBrand]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CatBrand](
	[CategoryID] [int] NOT NULL,
	[BrandID] [int] NOT NULL,
	[Sort] [int] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Category]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Category](
	[CategoryID] [int] IDENTITY(1,1) NOT NULL,
	[CategoryNo] [numeric](30, 0) NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TypeID] [int] NOT NULL,
	[ParentNo] [numeric](30, 0) NOT NULL,
	[CanAdd] [tinyint] NOT NULL,
	[ProductNum] [int] NOT NULL,
	[ProductPageSize] [int] NOT NULL,
	[InBar] [tinyint] NOT NULL,
	[InNav] [tinyint] NOT NULL,
	[PicsAndCSS] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Logo] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductAd] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[HeadAd] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[LastUpdate] [smalldatetime] NULL,
	[ParentPath] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[ChildIDs] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Depth] [int] NULL,
	[Child] [int] NULL,
	[Sort] [int] NULL,
	[IsActive] [tinyint] NULL,
	[IsDeleted] [tinyint] NOT NULL,
	[IsShow] [int] NULL,
	[Hit] [int] NULL,
	[NewsCatID] [int] NOT NULL CONSTRAINT [DF__Category__NewsCa__6A3191A0]  DEFAULT ((0)),
	[ScoreRate] [float] NULL,
	[BPRate] [float] NULL,
 CONSTRAINT [PK_Category] PRIMARY KEY CLUSTERED 
(
	[CategoryID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[CategoryField]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CategoryField](
	[CategoryFieldID] [int] NOT NULL,
	[CategoryFieldName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Complaint]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Complaint](
	[ComplaintID] [int] NOT NULL,
	[MemberID] [int] NULL,
	[CatID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Reply] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[ReplyTime] [smalldatetime] NULL,
	[AdminName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[MemberDelete] [int] NULL,
	[AdminDelete] [int] NULL,
	[IsReadReply] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ComplaintCat]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ComplaintCat](
	[ComplaintCatID] [int] NULL,
	[CatName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Config]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Config](
	[ConfigID] [int] NOT NULL,
	[SiteName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteUrl] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[CompanyName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Linkman] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Phone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Mobile] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Postalcode] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[Address] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SiteLogo] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[SiteTitle] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[MetaDescription] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[MetaKeywords] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Copyright] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpServer] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpAccount] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpPassword] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpMailbox] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpPort] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SmtpValidate] [tinyint] NOT NULL,
	[SmtpCode] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[DateFormat] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MarkUnit] [int] NULL,
	[ShopStop] [tinyint] NOT NULL,
	[ShopStopWords] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[UseCache] [tinyint] NOT NULL,
	[CacheTime] [int] NULL,
	[LinkAllowApply] [tinyint] NOT NULL,
	[LinkLogoWidth] [int] NULL,
	[LinkLogoHeight] [int] NULL,
	[UploadType] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[MaxFileSize] [int] NULL,
	[ProductPageSize] [int] NULL,
	[BulletinSizeInIndex] [int] NULL,
	[NewProductSizeInIndex] [int] NULL,
	[HotProductSizeInIndex] [int] NULL,
	[CommendProductSizeInIndex] [int] NULL,
	[DiscountProductSizeInIndex] [int] NULL,
	[Language] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[TemplateFolder] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[StatsToolName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[StatsCode] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[StatsLoginUrl] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[DefaultHeadAD] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[StorageAlert] [int] NULL,
	[OrderNumberRule] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AliPaySettings] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Settings] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[html] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PhoneMessage] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[uKeyEnabled] [int] NULL,
	[UKeyCode] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[WatermarkText] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberShowPrice] [int] NULL,
	[ShowSort] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[XpShopADType] [int] NULL,
	[MemberMaxAddressCount] [int] NULL,
	[ProductNoRule] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductReviewScore] [int] NULL,
	[TaxRate] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[RegScore] [int] NOT NULL,
	[CardScore] [int] NOT NULL,
	[ScoreRate] [decimal](18, 2) NOT NULL,
	[CnzzStatus] [bit] NOT NULL CONSTRAINT [DF_Config_CnzzStatus]  DEFAULT ((0)),
	[CnzzAccount] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[PicWatermark] [bit] NOT NULL CONSTRAINT [DF_Config_Watermark]  DEFAULT ((0)),
	[PicWatermarkPosition] [tinyint] NOT NULL CONSTRAINT [DF_Config_PicWatermarkPosition]  DEFAULT ((5)),
	[PicWatermarkTransparent] [real] NOT NULL CONSTRAINT [DF_Config_PicWatermarkTransparent]  DEFAULT ((80))
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Coupon]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Coupon](
	[CouponID] [int] IDENTITY(1,1) NOT NULL,
	[CouponName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponValue] [decimal](18, 2) NULL,
	[RuleID] [int] NULL,
	[Prefix] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GenQuantity] [int] NULL CONSTRAINT [DF_Coupon_GenQuantity]  DEFAULT ((0)),
	[CouponKey] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BeginTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[Status] [int] NULL CONSTRAINT [DF_Coupon_Status]  DEFAULT ((1)),
	[Type] [int] NULL CONSTRAINT [DF_Coupon_Type]  DEFAULT ((1)),
	[Score] [int] NULL,
	[Disabled] [int] NULL,
	[SupplierID] [int] NULL CONSTRAINT [DF_Coupon_SupplierID]  DEFAULT ((0)),
	[TotalNumber] [int] NULL CONSTRAINT [DF_Coupon_TotalNumber]  DEFAULT ((-1)),
	[UsedNumber] [int] NULL CONSTRAINT [DF_Coupon_UsedNumber]  DEFAULT ((0)),
	[MinMoney] [decimal](18, 2) NULL CONSTRAINT [DF_Coupon_MinMoney]  DEFAULT ((0)),
	[SuitType] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Coupon_SuitType]  DEFAULT ('所有'),
	[SuitValue] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Coupon_SuitValue]  DEFAULT ('all'),
	[Remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddIP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_Coupon_AddTime]  DEFAULT (getdate()),
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
 CONSTRAINT [PK_Coupon] PRIMARY KEY CLUSTERED 
(
	[CouponID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'派发数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'GenQuantity'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型:0为一张可无限使用,1为多张只适用一次' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'Type'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'兑换积分' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'Score'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'优惠券总数' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'TotalNumber'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已使用数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'UsedNumber'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可使用优惠券的最低订单金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Coupon', @level2type=N'COLUMN', @level2name=N'MinMoney'

GO
/****** 对象:  Table [dbo].[CouponCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CouponCart](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_CouponCart_uid]  DEFAULT (newid()),
	[CouponID] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CartID] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Memberid] [int] NOT NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_CouponCart_AddTime]  DEFAULT (getdate()),
	[Status] [int] NULL CONSTRAINT [DF_CouponCart_Status]  DEFAULT ((1)),
	[Remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NULL CONSTRAINT [DF_CouponCart_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_CouponCart] PRIMARY KEY CLUSTERED 
(
	[uid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[CouponsMember]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CouponsMember](
	[UID] [int] IDENTITY(1,1) NOT NULL,
	[CouponCode] [nvarchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_CouponsMember_CouponCode]  DEFAULT (newid()),
	[CouponID] [int] NOT NULL,
	[CouponName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponValue] [decimal](18, 2) NULL,
	[MemberID] [int] NULL,
	[MemberName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UsedTimes] [int] NULL CONSTRAINT [DF_CouponsMember_UsedTimes]  DEFAULT ((0)),
	[Status] [int] NULL CONSTRAINT [DF_CouponsMember_Status]  DEFAULT ((1)),
	[GetMethod] [tinyint] NULL,
	[SuitType] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SuitValue] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[MinMoney] [decimal](18, 2) NULL,
	[IsUsed] [bit] NULL CONSTRAINT [DF_CouponsMember_IsUsed]  DEFAULT ((0)),
	[UsedTime] [datetime] NULL,
	[UseUserID] [int] NULL,
	[IsSended] [bit] NULL CONSTRAINT [DF_CouponsMember_IsSended]  DEFAULT ((1)),
	[SendTime] [datetime] NULL CONSTRAINT [DF_CouponsMember_SendTime]  DEFAULT (getdate()),
	[SendReason] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Disabled] [bit] NULL,
	[Remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddUserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddUserIP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_CouponsMember_AddTime]  DEFAULT (getdate()),
	[IsPublic] [bit] NULL CONSTRAINT [DF_CouponsMember_IsPublic]  DEFAULT ((0)),
	[BeginTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[Type] [int] NULL,
	[SupplierID] [int] NULL,
	[Prefix] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponKey] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_CouponsMember] PRIMARY KEY CLUSTERED 
(
	[UID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用次数' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'CouponsMember', @level2type=N'COLUMN', @level2name=N'UsedTimes'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态：0为已使用，1为未使用' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'CouponsMember', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'派发途径：1线下派发，2为积分兑换，3为订单赠送，4为注册赠送，5管理员手工发放' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'CouponsMember', @level2type=N'COLUMN', @level2name=N'GetMethod'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用日期' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'CouponsMember', @level2type=N'COLUMN', @level2name=N'UsedTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否公有优惠券 0：私有；1公有' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'CouponsMember', @level2type=N'COLUMN', @level2name=N'IsPublic'

GO
/****** 对象:  Table [dbo].[CouponsUsedItems]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CouponsUsedItems](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NOT NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CouponID] [int] NOT NULL,
	[CouponName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CouponCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Type] [int] NULL,
	[UseUserID] [int] NULL,
	[UseTime] [datetime] NULL CONSTRAINT [DF_CouponsUsedItems_UseTime]  DEFAULT (getdate()),
	[SupplierID] [int] NULL CONSTRAINT [DF_CouponsUsedItems_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_CouponsUsedItems] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Currency]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Currency](
	[CurrencyID] [int] NOT NULL,
	[Name] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Code] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Sign] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Rate] [money] NULL,
	[IsDefault] [tinyint] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[CustomFieldItem]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CustomFieldItem](
	[CustomFieldItemID] [int] NOT NULL,
	[ShopProductID] [int] NULL,
	[ProductID] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FieldID] [int] NULL,
	[ItemName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Price] [money] NULL,
	[Selected] [tinyint] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Email]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Email](
	[EmailID] [int] NOT NULL,
	[Centent] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[EmailList]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EmailList](
	[mailid] [int] IDENTITY(1,1) NOT NULL,
	[ReceiverEmail] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[subject] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[body] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[format] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_EmailList_format]  DEFAULT ('text'),
	[AddTime] [datetime] NULL CONSTRAINT [DF_EmailList_AddTime]  DEFAULT (getdate()),
	[NeedSendTime] [datetime] NULL CONSTRAINT [DF_EmailList_NeedSendTime]  DEFAULT (getdate()),
	[SendTime] [datetime] NULL,
	[IsSended] [bit] NULL CONSTRAINT [DF_EmailList_IsSended]  DEFAULT ((0)),
	[itemid] [int] NULL,
 CONSTRAINT [PK_EmailList] PRIMARY KEY CLUSTERED 
(
	[mailid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[EvalReply]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EvalReply](
	[EvalReplyID] [int] IDENTITY(1,1) NOT NULL,
	[ShopEvalID] [int] NOT NULL,
	[SupplierID] [int] NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReplyTime] [datetime] NOT NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NOT NULL,
	[UserName] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
 CONSTRAINT [PK_EvalReply] PRIMARY KEY CLUSTERED 
(
	[EvalReplyID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Eventlog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Eventlog](
	[EventLogID] [int] IDENTITY(1,1) NOT NULL,
	[MemberID] [int] NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[RealName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[RootCatID] [int] NULL,
	[SubCatID] [int] NULL,
	[Description] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_Eventlog_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Eventlog] PRIMARY KEY CLUSTERED 
(
	[EventLogID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Express]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Express](
	[ExpressID] [int] IDENTITY(1,1) NOT NULL,
	[ExpressName] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TeL] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsUseful] [bit] NOT NULL CONSTRAINT [DF_Express_IsUseful]  DEFAULT ((0)),
	[Sort] [int] NOT NULL,
	[SupplierID] [int] NOT NULL,
	[QueryUrl] [varchar](400) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_Express] PRIMARY KEY CLUSTERED 
(
	[ExpressID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否最常用的快递公司' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Express', @level2type=N'COLUMN', @level2name=N'IsUseful'

GO
/****** 对象:  Table [dbo].[FavCat]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FavCat](
	[FavCatID] [int] NOT NULL,
	[CatName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberID] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Favorite]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Favorite](
	[FavoriteID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[FavCatID] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[FiltrateIP]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FiltrateIP](
	[FiltrateID] [int] NOT NULL,
	[IP] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[FinanceDetail]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FinanceDetail](
	[FinanceDetailID] [int] IDENTITY(1,1) NOT NULL,
	[OrderTime] [smalldatetime] NULL,
	[Issue] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_FinanceDetail_Issue]  DEFAULT ((0)),
	[OrderID] [int] NOT NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [money] NOT NULL,
	[TuiKuan] [money] NOT NULL,
	[YongJin] [money] NOT NULL CONSTRAINT [DF_FinanceDetail_Brokerage]  DEFAULT ((0)),
	[SupplierID] [int] NOT NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_FinanceDetail_Status]  DEFAULT ((0)),
	[AddTime] [datetime] NULL CONSTRAINT [DF_FinanceDetail_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_FinanceDetail_1] PRIMARY KEY CLUSTERED 
(
	[FinanceDetailID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'期号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'FinanceDetail', @level2type=N'COLUMN', @level2name=N'Issue'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单总金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'FinanceDetail', @level2type=N'COLUMN', @level2name=N'Amount'

GO
/****** 对象:  Table [dbo].[FinanceIssue]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FinanceIssue](
	[FinanceIssueID] [int] IDENTITY(1,1) NOT NULL,
	[Issue] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[StartTime] [smalldatetime] NOT NULL,
	[EndTime] [smalldatetime] NOT NULL,
 CONSTRAINT [PK_FinanceIssue] PRIMARY KEY CLUSTERED 
(
	[FinanceIssueID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[FinanceSummaries]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FinanceSummaries](
	[FinanceSummariesID] [int] IDENTITY(1,1) NOT NULL,
	[Issue] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [money] NOT NULL,
	[TuiKuan] [money] NOT NULL CONSTRAINT [DF_FinanceSummaries_TuiKuan]  DEFAULT ((0)),
	[YongJin] [money] NOT NULL CONSTRAINT [DF_FinanceSummaries_YongJin]  DEFAULT ((0)),
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_FinanceSummaries] PRIMARY KEY CLUSTERED 
(
	[FinanceSummariesID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[FinanceSummary]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FinanceSummary](
	[FinanceSummaryID] [int] IDENTITY(1,1) NOT NULL,
	[Issue] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [money] NOT NULL,
	[TuiKuan] [money] NOT NULL CONSTRAINT [DF_FinanceSummary_Drawback]  DEFAULT ((0)),
	[YongJin] [money] NOT NULL CONSTRAINT [DF_FinanceSummary_brokerage]  DEFAULT ((0)),
	[Status] [int] NOT NULL,
	[SupplierID] [int] NOT NULL,
	[Remark] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_FinanceSummary] PRIMARY KEY CLUSTERED 
(
	[Issue] ASC,
	[SupplierID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Fitting]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Fitting](
	[FittingID] [int] IDENTITY(1,1) NOT NULL,
	[ProductID] [int] NOT NULL,
	[FitID] [int] NOT NULL,
	[Sort] [int] NULL,
 CONSTRAINT [PK_Fitting] PRIMARY KEY CLUSTERED 
(
	[FittingID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[FlashAD]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FlashAD](
	[FlashID] [int] IDENTITY(1,1) NOT NULL,
	[FlashName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FlashImg] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FlashLink] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NULL,
	[ADCategoryID] [int] NULL,
	[Status] [int] NULL,
	[Folder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_FlashAD_AddTime]  DEFAULT (getdate()),
	[SupplierID] [int] NULL CONSTRAINT [DF_FlashAD_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_FlashAD] PRIMARY KEY CLUSTERED 
(
	[FlashID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Floor]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Floor](
	[FloorID] [int] IDENTITY(1,1) NOT NULL,
	[FloorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CatID] [int] NULL,
	[TopAD] [varchar](1000) COLLATE Chinese_PRC_CI_AS NULL,
	[ContentAD] [varchar](1000) COLLATE Chinese_PRC_CI_AS NULL,
	[Backgroundimage] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NULL,
	[Status] [int] NULL,
	[SupplierID] [int] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_Floor_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Floor] PRIMARY KEY CLUSTERED 
(
	[FloorID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顶部背景' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Floor', @level2type=N'COLUMN', @level2name=N'Backgroundimage'

GO
/****** 对象:  Table [dbo].[FloorPdt]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FloorPdt](
	[FloorPdtID] [int] IDENTITY(1,1) NOT NULL,
	[FloorID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[GoodsID] [int] NULL,
	[Sort] [int] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_FloorPdt_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_FloorPdt] PRIMARY KEY CLUSTERED 
(
	[FloorPdtID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Gift]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Gift](
	[GiftID] [int] IDENTITY(1,1) NOT NULL,
	[GiftName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GiftDesc] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[ThumbnailImg] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[GiftPic] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[RelatedImgs] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Gift_RelatedImgs_1]  DEFAULT (''),
	[Integral] [int] NULL,
	[AlreadyExchaged] [int] NOT NULL CONSTRAINT [DF_Gift_AlreadyExchaged1]  DEFAULT ((0)),
	[Weight] [decimal](18, 2) NULL CONSTRAINT [DF_Gift_Weight]  DEFAULT ((0)),
	[ProductID] [int] NOT NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GoodsID] [int] NULL,
	[GoodsNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Score] [int] NOT NULL,
	[Storage] [int] NOT NULL,
	[CatID] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[LimitedNumber] [int] NULL,
	[ExchagedMembers] [int] NULL CONSTRAINT [DF_Gift_ExchagedMembers]  DEFAULT ((0)),
 CONSTRAINT [PK_Gift_1] PRIMARY KEY CLUSTERED 
(
	[GiftID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已经兑换的数量，用来搞排行什么的' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Gift', @level2type=N'COLUMN', @level2name=N'AlreadyExchaged'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一个人最多可以兑换的礼品数' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Gift', @level2type=N'COLUMN', @level2name=N'LimitedNumber'

GO
/****** 对象:  Table [dbo].[GiftCat]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[GiftCat](
	[CatID] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CatName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Parent] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[childs] [int] NULL,
	[GiftNum] [int] NULL,
	[Logo] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[IsShow] [bit] NULL,
	[Status] [int] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[GiftOrder]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GiftOrder](
	[GiftOrderID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[OrderTime] [datetime] NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPhone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverEmail] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverAddress] [nvarchar](150) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPostalcode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TotalIntegral] [int] NOT NULL,
	[Gifts] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Method] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[GiftOrderItem]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GiftOrderItem](
	[GiftOrderItemID] [int] NOT NULL,
	[GiftOrderID] [int] NOT NULL,
	[GiftID] [int] NOT NULL,
	[GiftName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Integral] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[GiftOrderItems]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GiftOrderItems](
	[GiftOrderItemsID] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GiftID] [int] NOT NULL,
	[GiftName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Sum] [int] NOT NULL,
	[Method] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[GiftsCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[GiftsCart](
	[uid] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[cartid] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productid] [int] NULL,
	[productno] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productname] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[marketprice] [money] NULL,
	[memberprice] [money] NULL,
	[weight] [money] NULL,
	[pmtprice] [money] NULL,
	[giftnumber] [int] NULL,
	[subweight] [money] NULL,
	[submoney] [money] NULL,
	[lessmoney] [money] NULL,
	[pmtname] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ruleid] [int] NULL,
	[basictype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[subtype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[giftremark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_GiftsCart_addtime]  DEFAULT (getdate()),
	[adduser] [int] NULL,
	[addusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL,
	[updateuser] [int] NULL,
	[updateusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[updatehistory] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[isSystemAdd] [int] NULL,
	[pmtid] [int] NULL,
	[CouponID] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponValue] [money] NULL,
	[UseScore] [int] NOT NULL CONSTRAINT [DF_GiftsCart_UseScore]  DEFAULT ((0)),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_GiftsCart_SupplierID]  DEFAULT ((0)),
	[GoodsID] [int] NULL,
	[RuleName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ImgFolder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductImg] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SuitID] [int] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'兑换礼品使用的积分' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'GiftsCart', @level2type=N'COLUMN', @level2name=N'UseScore'

GO
/****** 对象:  Table [dbo].[GiftsCart_temp]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GiftsCart_temp](
	[uid] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[cartid] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productid] [int] NULL,
	[productno] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productname] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[marketprice] [money] NULL,
	[memberprice] [money] NULL,
	[pmtprice] [money] NULL,
	[giftnumber] [int] NULL,
	[submoney] [money] NULL,
	[lessmoney] [money] NULL,
	[pmtname] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ruleid] [int] NULL,
	[basictype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[subtype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[giftremark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL,
	[adduser] [int] NULL,
	[addusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL,
	[updateuser] [int] NULL,
	[updateusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[updatehistory] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Goods]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Goods](
	[GoodsID] [int] IDENTITY(1,1) NOT NULL,
	[ProductID] [int] NOT NULL,
	[GoodsNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Goods_GoodsNo]  DEFAULT (''),
	[MarketPrice] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Goods_MarketPrice_1]  DEFAULT ((0)),
	[MemberPrice] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Goods_MemberPrice_1]  DEFAULT ((0)),
	[Weight] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Goods_Weight_1]  DEFAULT ((0)),
	[Score] [int] NOT NULL CONSTRAINT [DF_Goods_Score_1]  DEFAULT ((0)),
	[MPicture] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Goods_MPicture_1]  DEFAULT (''),
	[SPicture] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Goods_SPicture_1]  DEFAULT (''),
	[BPicture] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Goods_BPicture]  DEFAULT (''),
	[Storage] [int] NOT NULL,
	[GoodsName] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_Goods_SupplierID]  DEFAULT ((0)),
	[Props] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PropsDesc] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_Goods_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Goods] PRIMARY KEY CLUSTERED 
(
	[GoodsID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[GoodsCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[GoodsCart](
	[uid] [nvarchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_GoodsCart_uid]  DEFAULT (newid()),
	[cartid] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productid] [int] NULL,
	[productno] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[productname] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[marketprice] [money] NULL,
	[memberprice] [money] NULL,
	[weight] [money] NULL,
	[pmtprice] [money] NULL,
	[quantity] [int] NULL,
	[subweight] [money] NULL,
	[submoney] [money] NULL,
	[lessmoney] [money] NULL,
	[pmtname] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ruleid] [int] NULL,
	[basictype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[subtype] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_GoodsCart_addtime]  DEFAULT (getdate()),
	[adduser] [int] NULL,
	[addusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[updatetime] [datetime] NULL,
	[updateuser] [int] NULL,
	[updateusername] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[updatehistory] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsID] [int] NULL,
	[IsDlvUnit] [int] NULL,
	[DlvUnit] [int] NULL,
	[MiniBuyNum] [int] NULL,
	[Score] [int] NULL,
	[StowageID] [int] NULL,
	[IsOfferInvoice] [int] NULL,
	[RecordID] [int] NULL,
	[ProductSpecs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[pmtid] [int] NULL,
	[CouponID] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponValue] [money] NULL,
	[IsDiscount] [tinyint] NOT NULL CONSTRAINT [DF_GoodsCart_IsDiscount]  DEFAULT ((0)),
	[UseScore] [int] NOT NULL CONSTRAINT [DF_GoodsCart_UseScore]  DEFAULT ((0)),
	[ScoreMoney] [money] NOT NULL CONSTRAINT [DF_GoodsCart_ScoreMoney]  DEFAULT ((0)),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_GoodsCart_SupplierID]  DEFAULT ((0)),
	[RuleName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ImgFolder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductImg] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SuitID] [int] NULL CONSTRAINT [DF_GoodsCart_SuitID]  DEFAULT ((0)),
	[Sort] [int] NULL,
 CONSTRAINT [PK_GoodsCart] PRIMARY KEY CLUSTERED 
(
	[uid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'积分抵扣的金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'GoodsCart', @level2type=N'COLUMN', @level2name=N'ScoreMoney'

GO
/****** 对象:  Table [dbo].[KeyLink]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[KeyLink](
	[KeyLinkID] [int] NOT NULL,
	[Keywords] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Link] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Sort] [int] NOT NULL,
	[Target] [tinyint] NOT NULL,
	[Status] [int] NOT NULL,
	[NewKeywords] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Keyword]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Keyword](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[KeyWord] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[PinYin] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Records] [int] NULL CONSTRAINT [DF_Keyword_Records]  DEFAULT ((0)),
	[KeyHot] [int] NULL CONSTRAINT [DF_Keyword_KeyHot]  DEFAULT ((1)),
	[Status] [tinyint] NULL CONSTRAINT [DF_Keyword_Status]  DEFAULT ((1)),
 CONSTRAINT [PK_Keyword] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Link]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Link](
	[LinkID] [int] NOT NULL,
	[Name] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Url] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Logo] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[Sort] [int] NOT NULL,
	[Home] [tinyint] NOT NULL,
	[Passed] [tinyint] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[listpage]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[listpage](
	[id] [int] NOT NULL,
	[strsql] [nvarchar](4000) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[log]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[log](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[content] [varchar](4000) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[addtime] [datetime] NOT NULL CONSTRAINT [DF_log_addtime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[LoginRecord]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[LoginRecord](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[MemberID] [int] NULL,
	[Account] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Password] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReturnResult] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[HTTP_REFERER] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[AbsoluteUri] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[IP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SessionID] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[LoginType] [tinyint] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_LoginRecord_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_LoginRecord] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'在登录页面登录为1,由cookie信息自动登录为2' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'LoginRecord', @level2type=N'COLUMN', @level2name=N'LoginType'

GO
/****** 对象:  Table [dbo].[MaxIDs]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MaxIDs](
	[TableName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MaxID] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Member]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Member](
	[MemberID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Password] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[HideEmail] [tinyint] NULL CONSTRAINT [DF_Member_HideEmail]  DEFAULT ((0)),
	[GroupId] [int] NULL CONSTRAINT [DF_Member_GroupId]  DEFAULT ((0)),
	[Remarks] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddDate] [datetime] NULL CONSTRAINT [DF_Member_AddDate]  DEFAULT (getdate()),
	[QQ] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Phone] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[MSN] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Question] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Answer] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Sex] [int] NULL CONSTRAINT [DF_Member_Sex]  DEFAULT ((0)),
	[Birthday] [datetime] NULL,
	[Realname] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[LastLog] [datetime] NULL CONSTRAINT [DF_Member_LastLog]  DEFAULT (getdate()),
	[LogTimes] [int] NULL CONSTRAINT [DF_Member_LogTimes]  DEFAULT ((0)),
	[Photo] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Introduction] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[AdvancePayment] [money] NULL,
	[Score] [int] NULL CONSTRAINT [DF_Member_Score]  DEFAULT ((0)),
	[Status] [int] NULL CONSTRAINT [DF_Member_Status]  DEFAULT ((1)),
	[Code] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Finance] [decimal](18, 2) NULL CONSTRAINT [DF_Member_Finance]  DEFAULT ((0)),
	[From] [int] NULL CONSTRAINT [DF_Member_From]  DEFAULT ((0)),
	[SupplierID] [int] NULL CONSTRAINT [DF_Member_SupplierID]  DEFAULT ((0)),
	[IsToErp] [tinyint] NULL CONSTRAINT [DF_Member_IsToErp]  DEFAULT ((0)),
	[Expenditure] [decimal](18, 2) NULL CONSTRAINT [DF_Member_Expenditure]  DEFAULT ((0)),
	[Mobile] [nvarchar](25) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF__Member__Mobile__553674BA]  DEFAULT (''),
	[AddressIDs] [nvarchar](25) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF__Member__AddressI__562A98F3]  DEFAULT (''),
	[Address] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF__Member__Address__0134F289]  DEFAULT (''),
	[PostCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF__Member__PostCode__022916C2]  DEFAULT (''),
	[Spending] [decimal](18, 2) NULL CONSTRAINT [DF_Member_Spending]  DEFAULT ((0)),
	[RegIP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[TPNo] [varchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[TPID] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[NickName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_Member] PRIMARY KEY CLUSTERED 
(
	[MemberID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否已经导入到erp系统里 0-否 1-已经导入' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Member', @level2type=N'COLUMN', @level2name=N'IsToErp'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'此会员的消费总额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Member', @level2type=N'COLUMN', @level2name=N'Spending'

GO
/****** 对象:  Table [dbo].[MemberBookPmtGoods]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MemberBookPmtGoods](
	[UID] [nvarchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_MemberBookPmtGoods_uid]  DEFAULT (newid()),
	[Type] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductID] [int] NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsID] [int] NULL,
	[GoodsNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Quantity] [int] NULL,
	[ReturnQuantity] [int] NULL,
	[RuleID] [int] NULL,
	[RuleName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtID] [int] NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_MemberBookPmtGoods_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL CONSTRAINT [DF_MemberBookPmtGoods_Status]  DEFAULT ((1)),
	[UpdatetTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_MemberBookPmtGoods_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_MemberBookPmtGoods] PRIMARY KEY CLUSTERED 
(
	[UID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[MemberBookSecKill]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MemberBookSecKill](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_MemberBookSecKill_uid]  DEFAULT (newid()),
	[ruleid] [int] NOT NULL,
	[rulename] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ruleno] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NOT NULL,
	[productid] [int] NULL,
	[goodsid] [int] NULL,
	[productname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[quantity] [int] NULL,
	[pmtprice] [decimal](18, 2) NULL,
	[OrderID] [int] NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ordertime] [datetime] NULL,
	[status] [int] NULL,
	[addip] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_MemberBookSecKill_addtime]  DEFAULT (getdate()),
	[adduser] [int] NULL,
	[updateuser] [int] NULL,
	[updatetime] [datetime] NULL,
	[auditor] [int] NULL,
	[audittime] [datetime] NULL,
	[supplierid] [int] NULL,
 CONSTRAINT [PK_MemberBookSecKill] PRIMARY KEY CLUSTERED 
(
	[uid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[MemberBookSuit]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MemberBookSuit](
	[cartid] [varchar](36) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NULL,
	[membername] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[suitid] [int] NULL,
	[suitname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[price] [decimal](18, 2) NULL,
	[score] [int] NULL,
	[orderid] [int] NULL,
	[orderno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[quantity] [int] NULL,
	[ordertime] [datetime] NULL,
	[supplierid] [int] NULL,
	[ip] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL CONSTRAINT [DF_MemberBookSuit_status]  DEFAULT ((1))
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[MemberBookTG]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MemberBookTG](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_MemberBookTG_uid]  DEFAULT (newid()),
	[ruleid] [int] NOT NULL,
	[rulename] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ruleno] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NOT NULL,
	[productid] [int] NULL,
	[goodsid] [int] NULL,
	[productname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[quantity] [int] NULL,
	[pmtprice] [decimal](18, 2) NULL,
	[OrderID] [int] NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ordertime] [datetime] NULL,
	[status] [int] NULL,
	[addip] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_MemberBookTG_addtime]  DEFAULT (getdate()),
	[adduser] [int] NULL,
	[updateuser] [int] NULL,
	[updatetime] [datetime] NULL,
	[auditor] [int] NULL,
	[audittime] [datetime] NULL,
	[supplierid] [int] NULL,
	[ReceiverAddress] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverPostalCode] [varchar](510) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverPhone] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverMobile] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[MemberExchangeGifts]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MemberExchangeGifts](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_MemberExchangeGifts_uid]  DEFAULT (newid()),
	[MemberID] [int] NULL,
	[MemberName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderID] [int] NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductID] [int] NULL,
	[ProductNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductName] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsID] [int] NULL,
	[GoodsNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsName] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Quantity] [int] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_MemberExchangeGifts_AddTime]  DEFAULT (getdate()),
	[Status] [int] NULL CONSTRAINT [DF_MemberExchangeGifts_Status]  DEFAULT ((1)),
	[SupplierID] [int] NULL CONSTRAINT [DF_MemberExchangeGifts_SupplierID]  DEFAULT ((0))
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[MemberGroup]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MemberGroup](
	[MemberGroupID] [int] NOT NULL,
	[GroupName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Discount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Logo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[LeastAmount] [decimal](18, 2) NOT NULL CONSTRAINT [DF_MemberGroup_LeastAmount]  DEFAULT ((0)),
	[IsDefault] [tinyint] NOT NULL CONSTRAINT [DF__MemberGro__IsDef__276FAA0A]  DEFAULT ((0)),
 CONSTRAINT [PK_MemberGroup] PRIMARY KEY CLUSTERED 
(
	[MemberGroupID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[MemberSubscriptions]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MemberSubscriptions](
	[MemberSubscriptionsID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[SubscriptionsOptionsIDs] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Message]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
	[MessageID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[SenderStatus] [int] NOT NULL,
	[ReceiverStatus] [int] NOT NULL,
	[FromMemberID] [int] NOT NULL,
	[ToMemberID] [int] NOT NULL,
	[SendType] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NavBar]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NavBar](
	[NavBarID] [int] NOT NULL,
	[NavBarName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Link] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Target] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NOT NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Inside] [tinyint] NOT NULL,
	[SupplierID] [int] NULL CONSTRAINT [DF_NavBar_SupplierID]  DEFAULT ((0))
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NewBid]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewBid](
	[NewBidID] [int] NOT NULL,
	[NewProductID] [int] NOT NULL,
	[ReceiverAddress] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPostalCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPhone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BidPrice] [decimal](18, 2) NOT NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CheckUp] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[Times] [datetime] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NewBuy]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewBuy](
	[NewBuyID] [int] NOT NULL,
	[NewProductID] [int] NOT NULL,
	[ReceiverAddress] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPostalCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPhone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuySum] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CheckUp] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[Times] [datetime] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NewNumber]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewNumber](
	[NewNumberID] [int] NOT NULL,
	[NewNumber] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[DateFrom] [datetime] NOT NULL,
	[DateTo] [datetime] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NewProduct]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewProduct](
	[NewProductID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[ProductName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Picture] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[LowPrice] [decimal](18, 2) NULL,
	[TopPrice] [decimal](18, 2) NULL,
	[Range] [decimal](18, 2) NULL,
	[PeopleSum] [int] NULL,
	[DateFrom] [datetime] NULL,
	[DateTo] [datetime] NULL,
	[Number] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Type] [int] NOT NULL,
	[AlreadyJoin] [int] NULL,
	[IsVote] [int] NULL,
	[Status] [int] NULL,
	[MemberGroup] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[News_Article]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[News_Article](
	[ArticleID] [int] NOT NULL,
	[Title] [nvarchar](150) COLLATE Chinese_PRC_CI_AS NULL,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[RootID] [int] NULL,
	[CategoryID] [int] NULL,
	[CategoryName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[images] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [smalldatetime] NULL,
	[Writer] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ArticleFrom] [nvarchar](150) COLLATE Chinese_PRC_CI_AS NULL,
	[Hits] [int] NULL,
	[Keys] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[IsHtml] [tinyint] NULL,
	[IsHot] [tinyint] NULL,
	[IsTop] [tinyint] NULL,
	[IsShow] [tinyint] NULL,
	[UserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[IsBest] [tinyint] NULL,
	[IsCreate] [tinyint] NULL,
	[EssayNum] [int] NULL,
	[isFormatRed] [int] NULL,
	[Status] [int] NULL,
	[NewContent] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[News_Category]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[News_Category](
	[CategoryID] [int] NOT NULL,
	[CategoryName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ParentID] [int] NULL,
	[ParentPath] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[ChildIDs] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Depth] [int] NULL,
	[RootID] [int] NULL,
	[Sort] [int] NULL,
	[Child] [int] NULL,
	[Readme] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[IsActive] [tinyint] NULL,
	[ArticleNum] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[NewsPdt]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewsPdt](
	[NewsPdtID] [int] NOT NULL,
	[NewsID] [int] NULL,
	[ProductID] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[OrderCoupon]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OrderCoupon](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_OrderCoupon_uid]  DEFAULT (newid()),
	[memberid] [int] NOT NULL,
	[membername] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[cartid] [varchar](36) COLLATE Chinese_PRC_CI_AS NULL,
	[orderid] [int] NULL,
	[orderno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[couponid] [int] NULL,
	[couponname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[couponvalue] [decimal](18, 2) NULL,
	[suittype] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[suitvalue] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[minmoney] [decimal](18, 2) NULL,
	[begintime] [datetime] NULL,
	[endtime] [datetime] NULL,
	[Validity] [int] NULL,
	[number] [int] NULL,
	[subnumber] [int] NULL,
	[productid] [int] NULL,
	[goodsid] [int] NULL,
	[ruleid] [int] NULL,
	[rulename] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[supplierid] [int] NULL,
	[sendreason] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[ip] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_OrderCoupon_addtime]  DEFAULT (getdate()),
	[updatetime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[OrderInvoice]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OrderInvoice](
	[OrderInvoiceID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NOT NULL,
	[InvoiceType] [int] NOT NULL,
	[InvoiceHead] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsDetails] [tinyint] NOT NULL CONSTRAINT [DF_OrderInvoice_IsDetails]  DEFAULT ((1)),
	[InvoiceContent] [nvarchar](300) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_OrderInvoice_AddTime]  DEFAULT (getdate()),
	[IsPrinted] [tinyint] NULL CONSTRAINT [DF_OrderInvoice_IsPrinted]  DEFAULT ((0)),
	[PrintTime] [datetime] NULL,
	[Printer] [int] NULL,
	[PrinterName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_OrderInvoice] PRIMARY KEY CLUSTERED 
(
	[OrderInvoiceID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否已打印' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderInvoice', @level2type=N'COLUMN', @level2name=N'IsPrinted'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'打印时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderInvoice', @level2type=N'COLUMN', @level2name=N'PrintTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'打印者ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderInvoice', @level2type=N'COLUMN', @level2name=N'Printer'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'打印者姓名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderInvoice', @level2type=N'COLUMN', @level2name=N'PrinterName'

GO
/****** 对象:  Table [dbo].[OrderOpLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OrderOpLog](
	[ID] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_OrderOpLog_ID]  DEFAULT (newid()),
	[OrderID] [int] NOT NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PreStatus] [int] NULL,
	[PreStatusInfo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[OPStatus] [int] NULL,
	[OPStatusInfo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Operator] [int] NULL,
	[OPName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[OPTime] [datetime] NOT NULL CONSTRAINT [DF_Table_1_AddTime]  DEFAULT (getdate()),
	[OPRule] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[OPDesc] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[OPRemark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_OrderOpLog_Status]  DEFAULT ((1)),
 CONSTRAINT [PK_OrderOpLog] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作前订单状态' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'PreStatus'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作前订单状态描述' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'PreStatusInfo'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作后订单状态' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPStatus'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作后订单状态描述' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPStatusInfo'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作员' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'Operator'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作员名字' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作角色' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPRule'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作描述' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPDesc'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderOpLog', @level2type=N'COLUMN', @level2name=N'OPRemark'

GO
/****** 对象:  Table [dbo].[OrderPresent]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderPresent](
	[OrderPresentID] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[ProductID] [int] NULL,
	[GiftID] [int] NOT NULL,
	[PresentName] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[PresentNum] [int] NOT NULL,
	[Ptype] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[OrderProduct]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[OrderProduct](
	[OrderProductID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NOT NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductID] [int] NOT NULL,
	[Items] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Quantity] [int] NOT NULL,
	[CostPrice] [decimal](18, 2) NULL,
	[MemberPrice] [decimal](18, 2) NULL,
	[UnitPrice] [decimal](18, 2) NOT NULL,
	[SubPrice] [decimal](18, 2) NOT NULL,
	[ItemsPrice] [decimal](18, 2) NULL CONSTRAINT [DF_OrderProduct_ItemsPrice]  DEFAULT ((0)),
	[LessMoney] [decimal](18, 2) NULL CONSTRAINT [DF_OrderProduct_LessMoney]  DEFAULT ((0)),
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[IsDiscount] [tinyint] NULL CONSTRAINT [DF_OrderProduct_IsDiscount]  DEFAULT ((0)),
	[ProductName] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductSpecs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_OrderProduct_ProductNo]  DEFAULT (''),
	[ThumbnailImg] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CategoryID] [int] NOT NULL CONSTRAINT [DF_OrderProduct_CategoryID_1]  DEFAULT ((1)),
	[BrandID] [int] NOT NULL,
	[GoodsID] [int] NOT NULL CONSTRAINT [DF__OrderProd__Goods__0A695708]  DEFAULT ((0)),
	[UsedScore] [int] NOT NULL CONSTRAINT [DF__OrderProd__UsedS__61873D06]  DEFAULT ((0)),
	[Ptype] [int] NOT NULL CONSTRAINT [DF__OrderProd__Ptype__742FFD26]  DEFAULT ((1)),
	[GiftScore] [int] NULL CONSTRAINT [DF__OrderProd__GiftS__7524215F]  DEFAULT ((0)),
	[GiftGetType] [int] NULL CONSTRAINT [DF__OrderProd__GiftG__76184598]  DEFAULT ((0)),
	[StowageID] [int] NULL,
	[IsOfferInvoice] [tinyint] NULL,
	[RuleID] [int] NULL,
	[RuleName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtID] [int] NULL,
	[PmtName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponsMemberID] [int] NULL,
	[CouponValue] [money] NULL,
	[CouponGoodsMoney] [float] NULL,
	[AvgCouponMoney] [float] NULL,
	[IsNeedStowage] [int] NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_OrderProduct_SupplierID]  DEFAULT ((0)),
	[Stockout] [int] NULL,
	[CommentStatus] [tinyint] NOT NULL CONSTRAINT [DF_OrderProduct_CommentStatus]  DEFAULT ((0)),
	[MemberID] [int] NULL,
	[OrderTime] [datetime] NULL,
	[Score] [int] NULL CONSTRAINT [DF_OrderProduct_Score]  DEFAULT ((0)),
	[PackingList] [varchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[IsDel] [bit] NULL CONSTRAINT [DF_OrderProduct_IsDel]  DEFAULT ((0)),
 CONSTRAINT [PK_OrderProduct] PRIMARY KEY CLUSTERED 
(
	[OrderProductID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1普通商品,2礼品' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'Ptype'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'如果是礼品,这里记录礼品兑换所需的积分数,如果是普通商品,这里为0' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'GiftScore'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'如果是礼品，还要记录这个礼品的获取方式，为1是使用积分兑换，为2是订单赠送' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'GiftGetType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'还需发货数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'Stockout'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'顾客对购买过的商品的评价状态，0 不可评价， 1是可评价，2是已评价' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'CommentStatus'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否已删除' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'OrderProduct', @level2type=N'COLUMN', @level2name=N'IsDel'

GO
/****** 对象:  Table [dbo].[OrderProductItem]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderProductItem](
	[OrderProductItemID] [int] NOT NULL,
	[OrderProductID] [int] NULL,
	[Quantity] [int] NULL,
	[FieldItemID] [int] NULL,
	[FieldItemName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ItemPrice] [money] NULL,
	[AddTime] [smalldatetime] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[OrderReview]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderReview](
	[OrderReviewID] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[Body] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Reply] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Type] [int] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[IP] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Orders]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Orders](
	[OrderID] [int] IDENTITY(1,1) NOT NULL,
	[MemberID] [int] NOT NULL,
	[OrderTime] [smalldatetime] NOT NULL,
	[SendTime] [smalldatetime] NULL,
	[ReceiveTime] [smalldatetime] NULL,
	[CancelTime] [smalldatetime] NULL,
	[ShipTime] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerPhone] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerMobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[BuyerEmail] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerAddress] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[BuyerPostalcode] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPhone] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverMobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverEmail] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverAddress] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPostalcode] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TotalPrice] [decimal](18, 2) NOT NULL,
	[LessMoney] [decimal](18, 2) NULL CONSTRAINT [DF_Orders_LessMoney]  DEFAULT ((0)),
	[ProductPrice] [decimal](18, 2) NOT NULL,
	[CustomItemPrice] [decimal](18, 2) NOT NULL,
	[Discount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ShipPrice] [decimal](18, 2) NOT NULL,
	[AdvancePayment] [decimal](18, 2) NOT NULL,
	[PaymentType] [int] NOT NULL,
	[ShippingType] [int] NOT NULL,
	[Score] [int] NOT NULL,
	[Weight] [decimal](10, 0) NOT NULL,
	[Quantity] [int] NOT NULL,
	[NeedInvoice] [tinyint] NOT NULL,
	[TaxPrice] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Orders_TaxPrice]  DEFAULT ((0)),
	[CltCharge] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Orders_CltCharge]  DEFAULT ((0)),
	[PayType] [int] NOT NULL CONSTRAINT [DF_Orders_PayStatus]  DEFAULT ((0)),
	[Status] [int] NOT NULL CONSTRAINT [DF_Orders_Status]  DEFAULT ((0)),
	[ManageHistory] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Orders_ManageHistory]  DEFAULT (''),
	[LastModify] [int] NOT NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Code] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsAgentF] [int] NOT NULL,
	[IsAgentFContent] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsShippingFree] [int] NOT NULL,
	[Type] [int] NOT NULL CONSTRAINT [DF_Orders_Type]  DEFAULT ((1)),
	[Favourable] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Orders_Favourable]  DEFAULT (''),
	[ZtdNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Orders_ZtdID]  DEFAULT ('00'),
	[IsToErp] [tinyint] NOT NULL CONSTRAINT [DF_Orders_IsInput]  DEFAULT ((0)),
	[OrderType] [int] NOT NULL CONSTRAINT [DF_Orders_OrderType]  DEFAULT ((0)),
	[IsToMessage] [tinyint] NOT NULL CONSTRAINT [DF__orders__IsToMess__614745E4]  DEFAULT ((0)),
	[AddMethod] [int] NOT NULL CONSTRAINT [DF__Orders__AddMothe__534E2C48]  DEFAULT ((1)),
	[AddressID] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF__Orders__AddressI__54425081]  DEFAULT (''),
	[UsedScore] [int] NOT NULL CONSTRAINT [DF__Orders__UsedScor__627B613F]  DEFAULT ((0)),
	[ScoreAmount] [decimal](18, 2) NOT NULL CONSTRAINT [DF__Orders__ScoreAmo__636F8578]  DEFAULT ((0)),
	[RuleID] [int] NULL,
	[RuleName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtID] [int] NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponsMemberID] [int] NULL,
	[CouponName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponValue] [money] NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_Orders_SupplierID]  DEFAULT ((0)),
	[PayTime] [datetime] NULL,
	[FinishTime] [datetime] NULL,
	[NeedPayMoney] [decimal](18, 2) NULL,
	[ServiceStatus] [int] NULL,
	[CancelType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[IsDel] [bit] NULL CONSTRAINT [DF_Orders_IsDel]  DEFAULT ((0)),
	[BankID] [int] NULL CONSTRAINT [DF_Orders_BankID]  DEFAULT ((0)),
	[FQPeriods] [int] NULL CONSTRAINT [DF_Orders_FQPeriods]  DEFAULT ((0)),
	[FQCharges] [decimal](18, 2) NULL CONSTRAINT [DF_Orders_FQCharges]  DEFAULT ((0)),
 CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED 
(
	[OrderID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否需要发票' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'NeedInvoice'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发票税金' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'TaxPrice'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'托收手续费' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'CltCharge'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付类型0-款到发货 1-自提 2-货到付款' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'PayType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单的状态啦 0-未付款 1-已付款-未确认 2-已确认-未发货(正在配货) 3-已发货-未签收 4-已签收 5-已退单-未退款 6-已退款 7-已作废 12-已归档' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1为正常下订流程的订单，2为团购,3拍卖的订单,4为合并的订单' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'Type'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'该订单享受的订单优惠' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'Favourable'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'门店编码' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'ZtdNo'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否已经导入到erp系统里 0-否 1-已经导入' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'IsToErp'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0网上订单 1电话订单' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'OrderType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'为1是会员在线下的订单,为是2管理员手动添加的订单' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'AddMethod'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用了多少积分' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'UsedScore'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用积分抵消了多少金额' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'ScoreAmount'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'售后状态' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'ServiceStatus'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识订单是否已经被删除' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Orders', @level2type=N'COLUMN', @level2name=N'IsDel'

GO
/****** 对象:  Table [dbo].[OutStockReg]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OutStockReg](
	[OutStockRegID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[NotifyTime] [datetime] NOT NULL,
	[IsNotified] [bit] NOT NULL,
	[ProductSpecs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GoodsID] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PayInterface]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PayInterface](
	[InterfaceID] [int] NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayTypeID] [int] NOT NULL,
	[Status] [tinyint] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Payment]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Payment](
	[PaymentID] [int] NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[InterfaceID] [int] NOT NULL,
	[UserID] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[PrivateKey] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SupportCoins] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NULL,
	[Status] [int] NULL,
	[PayType] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[paymentgift]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[paymentgift](
	[orderid] [int] NULL,
	[orderno] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[memberid] [int] NULL,
	[paymenttype] [int] NULL,
	[productid] [int] NULL,
	[goodsid] [int] NULL,
	[productname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[quantity] [int] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_paymentgift_AddTime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PayNotify]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PayNotify](
	[PayNotifyID] [int] NOT NULL,
	[OrderID] [int] NOT NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
	[PayerBank] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayerAccount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayerName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverBank] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverAccount] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PayType] [int] NOT NULL,
	[PayTime] [smalldatetime] NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[Attach] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [int] NOT NULL,
	[IsDelete] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PayNotifyLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PayNotifyLog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[url] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[type] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[content] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_PayNotifyLog_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_PayNotifyLog] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PayType]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PayType](
	[PayTypeID] [int] NOT NULL,
	[PayTypeName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NOT NULL,
	[Status] [tinyint] NOT NULL,
	[Sid] [int] NULL CONSTRAINT [DF_PayType_Sid]  DEFAULT ((-1))
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家ID,-1为所有商家' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PayType', @level2type=N'COLUMN', @level2name=N'Sid'

GO
/****** 对象:  Table [dbo].[PdtCity]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PdtCity](
	[productid] [int] NOT NULL,
	[city] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PdtImg]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PdtImg](
	[id] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_PdtImg_id]  DEFAULT (newid()),
	[pid] [int] NOT NULL,
	[gid] [int] NULL,
	[skuprops] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img1] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img2] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img3] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img4] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img5] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[img6] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[imgfolder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[imgdomain] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[sid] [int] NULL,
	[isdel] [int] NULL,
	[status] [int] NULL,
	[addtime] [datetime] NOT NULL CONSTRAINT [DF_PdtImg_addtime]  DEFAULT (getdate()),
	[sort] [tinyint] NULL,
 CONSTRAINT [PK_PdtImg] PRIMARY KEY NONCLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PdtPropImg]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PdtPropImg](
	[PicID] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_PdtPropImg_PicID]  DEFAULT (newid()),
	[Pid] [int] NOT NULL,
	[Props] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Img] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ImgFolder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ImgDomain] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Url] [varchar](300) COLLATE Chinese_PRC_CI_AS NULL,
	[Sid] [int] NULL CONSTRAINT [DF_PdtPropImg_Sid]  DEFAULT ((0)),
	[Status] [int] NULL CONSTRAINT [DF_PdtPropImg_Status]  DEFAULT ((1)),
	[AddTime] [datetime] NULL CONSTRAINT [DF_PdtPropImg_AddTime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PdtTag]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PdtTag](
	[PdtTagID] [int] IDENTITY(1,1) NOT NULL,
	[ProductID] [int] NOT NULL,
	[TagID] [int] NOT NULL,
	[IsHomeShow] [bit] NOT NULL,
	[CategoryID] [int] NOT NULL,
	[CategoryNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Sort] [int] NOT NULL,
 CONSTRAINT [PK_PdtTag] PRIMARY KEY CLUSTERED 
(
	[PdtTagID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PdtType]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PdtType](
	[TypeID] [int] NOT NULL,
	[TypeName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Props] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Paras] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Prop1] [int] NULL,
	[Prop2] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Permission]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Permission](
	[pid] [int] IDENTITY(1,1) NOT NULL,
	[permission] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL CONSTRAINT [DF_Permission_status]  DEFAULT ((1)),
 CONSTRAINT [PK_Permission] PRIMARY KEY CLUSTERED 
(
	[pid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PmtCoupons]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PmtCoupons](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_PmtCoupons_uid]  DEFAULT (newid()),
	[PmtID] [int] NULL,
	[PmtName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[RuleID] [int] NULL,
	[RuleNo] [int] NULL,
	[RuleName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BasicType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SubType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponID] [int] NULL,
	[CouponName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Validity] [int] NULL,
	[Number] [int] NULL,
	[Balance] [int] NULL,
	[LimitedNumber] [int] NULL,
	[IsLimited] [bit] NULL,
	[Remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_PmtCoupons_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varbinary](50) NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Status] [int] NULL,
	[SupplierID] [int] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PmtCoupons1]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PmtCoupons1](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[PmtID] [int] NOT NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[RuleID] [int] NOT NULL,
	[RuleNo] [int] NULL,
	[RuleName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[CouponID] [int] NOT NULL,
	[CouponName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_PmtCoupon_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NOT NULL CONSTRAINT [DF_PmtCoupon_UpdateTime]  DEFAULT (getdate()),
	[UpdateUser] [int] NULL,
	[UpdateUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_PmtCoupon_Status]  DEFAULT ((1)),
	[Auditor] [int] NULL,
	[AuditorName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_PmtCoupons_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_PmtCoupon] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtCoupons1', @level2type=N'COLUMN', @level2name=N'AuditTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtCoupons1', @level2type=N'COLUMN', @level2name=N'SupplierID'

GO
/****** 对象:  Table [dbo].[PmtGenCoupons]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PmtGenCoupons](
	[PmtGenCouponsID] [int] NOT NULL,
	[PromotionID] [int] NOT NULL,
	[CouponsID] [int] NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_PmtGenCoupon] PRIMARY KEY CLUSTERED 
(
	[PmtGenCouponsID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PmtGifts]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PmtGifts](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[PmtID] [int] NOT NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[RuleID] [int] NOT NULL,
	[RuleNo] [int] NULL,
	[RuleName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BasicType] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SubType] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductID] [int] NOT NULL,
	[GoodsID] [int] NULL,
	[ProductName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[CategoryID] [int] NULL,
	[BrandID] [int] NULL,
	[BrandName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UseScore] [int] NULL,
	[Score] [int] NULL,
	[IsOfferInvoice] [int] NULL,
	[MarketPrice] [money] NULL,
	[MemberPrice] [money] NULL,
	[PmtPrice] [money] NULL,
	[Stowageid] [int] NULL,
	[PmtNumber] [int] NULL,
	[Balance] [int] NULL,
	[LimitedNumber] [int] NULL,
	[IsLimited] [int] NULL,
	[MaxNumber] [int] NULL,
	[IsSelected] [int] NULL,
	[GiftType] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GroupName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[AddUser] [int] NULL,
	[AddUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[UpdateTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL,
 CONSTRAINT [PK_PmtGifts] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PmtGoods]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PmtGoods](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[PmtID] [int] NOT NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[RuleID] [int] NOT NULL,
	[RuleNo] [int] NULL,
	[RuleName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BasicType] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SubType] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[TagID] [int] NULL CONSTRAINT [DF_PmtGoods_TagID]  DEFAULT ((0)),
	[ProductID] [int] NOT NULL,
	[GoodsID] [int] NULL,
	[ProductName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[CategoryID] [int] NULL,
	[BrandID] [int] NULL,
	[BrandName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UseScore] [int] NULL CONSTRAINT [DF_PmtGoods_UseScore]  DEFAULT ((0)),
	[Score] [int] NULL CONSTRAINT [DF_PmtGoods_Score]  DEFAULT ((0)),
	[IsOfferInvoice] [int] NULL CONSTRAINT [DF_PmtGoods_IsOfferInvoice]  DEFAULT ((1)),
	[MarketPrice] [money] NULL,
	[MemberPrice] [money] NULL,
	[PmtPrice] [money] NULL,
	[Stowageid] [int] NULL CONSTRAINT [DF_PmtGoods_Stowageid]  DEFAULT ((0)),
	[PmtNumber] [int] NULL,
	[Balance] [int] NULL,
	[LimitedNumber] [int] NULL,
	[IsLimited] [int] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_PmtGoods_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_PmtGoods_Status]  DEFAULT ((0)),
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_PmtGoods_UpdateTime]  DEFAULT (getdate()),
	[UpdateUser] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_PmtGoods_SupplierID]  DEFAULT ((0)),
	[sort] [int] NULL CONSTRAINT [DF_PmtGoods_sort]  DEFAULT ((1)),
	[IsHomeShow] [bit] NULL CONSTRAINT [DF_PmtGoods_IsHomeShow]  DEFAULT ((1)),
 CONSTRAINT [PK_PmtGoods] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标签ID:调标签图片的扩展字段' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'TagID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'促销价格' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'PmtPrice'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'促销数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'PmtNumber'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'剩余数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'Balance'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每个人限购数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'LimitedNumber'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否限制购买数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'IsLimited'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:-1审核未通过,0未审核,1审核通过' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtGoods', @level2type=N'COLUMN', @level2name=N'SupplierID'

GO
/****** 对象:  Table [dbo].[PmtList]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PmtList](
	[PmtID] [int] IDENTITY(1,1) NOT NULL,
	[PmtName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[BeginTime] [datetime] NOT NULL,
	[EndTime] [datetime] NOT NULL,
	[Description] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtType] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_PmtList_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_Promotionlist_Status]  DEFAULT ((0)),
	[UpdateTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [nvarchar](800) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[IsCanUsedCoupon] [tinyint] NOT NULL CONSTRAINT [DF_Promotionlist_IsCanUsedCoupon]  DEFAULT ((0)),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_PmtList_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_PmtList] PRIMARY KEY CLUSTERED 
(
	[PmtID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'促销活动名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'PmtName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'BeginTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'EndTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'Description'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'活动类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'PmtType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'AddTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加人' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'AddUser'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:-1审核不通过，0未审核，1通过' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'UpdateTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新人' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'UpdateUser'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'更新历史' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'UpdateHistory'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'Remark'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'还能否使用优惠券:0不可以,1可以' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'IsCanUsedCoupon'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtList', @level2type=N'COLUMN', @level2name=N'SupplierID'

GO
/****** 对象:  Table [dbo].[PmtProduct]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PmtProduct](
	[PmtProductID] [int] NOT NULL,
	[PromotionID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
 CONSTRAINT [PK_PmtProduct] PRIMARY KEY CLUSTERED 
(
	[PmtProductID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[PmtRule]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PmtRule](
	[RuleID] [int] IDENTITY(1,1) NOT NULL,
	[RuleName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtID] [int] NULL,
	[RuleNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BasicType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SubType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BeginTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[Discount] [decimal](18, 2) NULL,
	[LessMoney] [money] NULL,
	[MinValue] [money] NULL,
	[MaxValue] [money] NULL,
	[IsAutoAdded] [int] NULL,
	[Condition] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[GroupIDs] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_PmtRule_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_PromotionRule_Status]  DEFAULT ((0)),
	[UpdateTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateHistory] [varchar](800) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[Remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_PmtRule_SupplierID]  DEFAULT ((0)),
	[CanUseCoupon] [bit] NULL CONSTRAINT [DF_PmtRule_CanUseCoupons]  DEFAULT ((0)),
	[PmtType] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[PmtTypeName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[IsHomeShow] [bit] NULL CONSTRAINT [DF_PmtRule_IsHomeShow]  DEFAULT ((1)),
	[BankNo] [varchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[RuleAD] [varchar](1000) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_PromotionRule] PRIMARY KEY CLUSTERED 
(
	[RuleID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'基本类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'BasicType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类型' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'SubType'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'Discount'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'减少金额:订单满额立减多少' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'LessMoney'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最小数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'MinValue'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最大数量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'MaxValue'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'适用规则的会员组ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'GroupIDs'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态:-1审核不通过,0未审核,1审核通过' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'PmtRule', @level2type=N'COLUMN', @level2name=N'SupplierID'

GO
/****** 对象:  Table [dbo].[Poll]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Poll](
	[PollID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Items] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Vote] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Multiple] [tinyint] NOT NULL,
	[inIndex] [tinyint] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Present]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Present](
	[PresentID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[GiftID] [int] NOT NULL,
	[Ptype] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[PresentNum] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Product]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Product](
	[ProductID] [int] IDENTITY(1,1) NOT NULL,
	[ProductGroup] [int] NULL,
	[ProductName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CategoryID] [int] NOT NULL CONSTRAINT [DF_Product_CategoryID]  DEFAULT ((1)),
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_ProductNo]  DEFAULT (''),
	[BrandID] [int] NOT NULL CONSTRAINT [DF_Product_BrandID]  DEFAULT ((0)),
	[BrandName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_BrandName]  DEFAULT (''),
	[ShortDesc] [varchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_ShortDesc]  DEFAULT (''),
	[Unit] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_Unit]  DEFAULT (''),
	[Weight] [decimal](18, 2) NOT NULL,
	[CostPrice] [decimal](18, 2) NULL,
	[MarketPrice] [decimal](18, 2) NOT NULL,
	[MemberPrice] [decimal](18, 2) NOT NULL,
	[Score] [int] NOT NULL CONSTRAINT [DF_Product_Score]  DEFAULT ((0)),
	[ThumbnailImg] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_ThumbnailImg]  DEFAULT ('nopic.gif'),
	[ProductImg] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_ProductImg]  DEFAULT (''),
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_Description]  DEFAULT (''),
	[PackingList] [varchar](500) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_PackingList]  DEFAULT (''),
	[AfterService] [varchar](1000) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_AfterService]  DEFAULT (''),
	[Storage] [int] NOT NULL CONSTRAINT [DF_Product_Storage]  DEFAULT ((0)),
	[AarnNum] [int] NOT NULL CONSTRAINT [DF_Product_MiniNum]  DEFAULT ((0)),
	[IsForSale] [tinyint] NOT NULL,
	[IsBuyLimited] [tinyint] NOT NULL,
	[IsPackaged] [tinyint] NOT NULL CONSTRAINT [DF_Product_IsPackaged]  DEFAULT ((0)),
	[PackageInfo] [nvarchar](1500) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_PackageInfo]  DEFAULT (''),
	[StartTime] [smalldatetime] NULL,
	[EndTime] [smalldatetime] NULL,
	[AddTime] [datetime] NOT NULL,
	[Status] [int] NOT NULL CONSTRAINT [DF_Product_Status]  DEFAULT ((0)),
	[Sort] [int] NOT NULL CONSTRAINT [DF_Product_Sort]  DEFAULT ((0)),
	[IsVirtual] [tinyint] NOT NULL CONSTRAINT [DF_Product_IsVirtual]  DEFAULT ((0)),
	[CanReview] [tinyint] NOT NULL CONSTRAINT [DF_Product_CanReview]  DEFAULT ((1)),
	[IsDiscount] [tinyint] NOT NULL CONSTRAINT [DF_Product_IsDiscount]  DEFAULT ((1)),
	[Img5] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_RelatedImgs]  DEFAULT (''),
	[Hits] [int] NOT NULL CONSTRAINT [DF_Product_Hits]  DEFAULT ((0)),
	[MiniBuyNum] [int] NOT NULL CONSTRAINT [DF_Product_Min]  DEFAULT ((1)),
	[Spec] [nvarchar](2000) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_Spec]  DEFAULT (''),
	[SpecDesc] [nvarchar](2000) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_SpecDesc]  DEFAULT (''),
	[Properties] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Product_Properties]  DEFAULT (''),
	[SaleNum] [int] NOT NULL CONSTRAINT [DF_Product_SaleNum]  DEFAULT ((0)),
	[Title] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_Title]  DEFAULT (''),
	[MetaKeywords] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_MetaKeywords]  DEFAULT (''),
	[MetaDescription] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_MetaDescription]  DEFAULT (''),
	[Keyword] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_Keyword]  DEFAULT (''),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_Product_SupplierID]  DEFAULT ((0)),
	[UseScore] [int] NOT NULL CONSTRAINT [DF_Product_UseScore]  DEFAULT ((0)),
	[P1] [tinyint] NOT NULL CONSTRAINT [DF_Product_P1]  DEFAULT ((0)),
	[P2] [tinyint] NOT NULL CONSTRAINT [DF_Product_P2]  DEFAULT ((0)),
	[P3] [tinyint] NOT NULL CONSTRAINT [DF_Product_P3]  DEFAULT ((0)),
	[P4] [tinyint] NOT NULL CONSTRAINT [DF_Product_P4]  DEFAULT ((0)),
	[P5] [tinyint] NOT NULL CONSTRAINT [DF_Product_P5]  DEFAULT ((0)),
	[P6] [tinyint] NOT NULL CONSTRAINT [DF_Product_P6]  DEFAULT ((0)),
	[P7] [tinyint] NOT NULL CONSTRAINT [DF_Product_P7]  DEFAULT ((0)),
	[P8] [tinyint] NOT NULL CONSTRAINT [DF_Product_P8]  DEFAULT ((0)),
	[P9] [tinyint] NOT NULL CONSTRAINT [DF_Product_P9]  DEFAULT ((0)),
	[P10] [tinyint] NOT NULL CONSTRAINT [DF_Product_P10]  DEFAULT ((0)),
	[P11] [tinyint] NOT NULL CONSTRAINT [DF_Product_P11]  DEFAULT ((0)),
	[P12] [tinyint] NOT NULL CONSTRAINT [DF_Product_P12]  DEFAULT ((0)),
	[P13] [tinyint] NOT NULL CONSTRAINT [DF_Product_P13]  DEFAULT ((0)),
	[P14] [tinyint] NOT NULL CONSTRAINT [DF_Product_P14]  DEFAULT ((0)),
	[P15] [tinyint] NOT NULL CONSTRAINT [DF_Product_P15]  DEFAULT ((0)),
	[P16] [tinyint] NOT NULL CONSTRAINT [DF_Product_P16]  DEFAULT ((0)),
	[P17] [tinyint] NOT NULL CONSTRAINT [DF_Product_P17]  DEFAULT ((0)),
	[P18] [tinyint] NOT NULL CONSTRAINT [DF_Product_P18]  DEFAULT ((0)),
	[P19] [tinyint] NOT NULL CONSTRAINT [DF_Product_P19]  DEFAULT ((0)),
	[P20] [tinyint] NOT NULL CONSTRAINT [DF_Product_P20]  DEFAULT ((0)),
	[P21] [tinyint] NOT NULL CONSTRAINT [DF_Product_P21]  DEFAULT ((0)),
	[P22] [tinyint] NOT NULL CONSTRAINT [DF_Product_P22]  DEFAULT ((0)),
	[P23] [tinyint] NOT NULL CONSTRAINT [DF_Product_P23]  DEFAULT ((0)),
	[P24] [tinyint] NOT NULL CONSTRAINT [DF_Product_P24]  DEFAULT ((0)),
	[P25] [tinyint] NOT NULL CONSTRAINT [DF_Product_P25]  DEFAULT ((0)),
	[P26] [tinyint] NOT NULL CONSTRAINT [DF_Product_P26]  DEFAULT ((0)),
	[P27] [tinyint] NOT NULL CONSTRAINT [DF_Product_P27]  DEFAULT ((0)),
	[P28] [tinyint] NOT NULL CONSTRAINT [DF_Product_P28]  DEFAULT ((0)),
	[P29] [tinyint] NOT NULL CONSTRAINT [DF_Product_P29]  DEFAULT ((0)),
	[P30] [tinyint] NOT NULL CONSTRAINT [DF_Product_P30]  DEFAULT ((0)),
	[CategoryNo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[SubCategoryID] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Price1] [decimal](18, 2) NULL,
	[Price2] [decimal](18, 2) NULL,
	[ImgFolder] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ImgDomain] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[IsDlvUnit] [tinyint] NULL,
	[DlvUnit] [int] NULL,
	[IsOfferInvoice] [tinyint] NULL,
	[Reviews] [int] NULL CONSTRAINT [DF_Product_Reviews]  DEFAULT ((0)),
	[pj1] [decimal](18, 2) NULL CONSTRAINT [DF_Product_pj1]  DEFAULT ((0)),
	[pj2] [decimal](18, 2) NULL CONSTRAINT [DF_Product_pj2]  DEFAULT ((0)),
	[pj3] [decimal](18, 2) NULL CONSTRAINT [DF_Product_pj3]  DEFAULT ((0)),
	[pj4] [decimal](18, 2) NULL CONSTRAINT [DF_Product_pj4]  DEFAULT ((0)),
	[pj5] [decimal](18, 2) NULL CONSTRAINT [DF_Product_pj5]  DEFAULT ((0)),
	[pingfen] [decimal](18, 2) NULL,
	[IsNeedStorage] [tinyint] NOT NULL CONSTRAINT [DF_Product_IsNeedStorage]  DEFAULT ((1)),
	[SkuMap] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Product_SkuMap]  DEFAULT (''),
	[IsDel] [int] NULL CONSTRAINT [DF_Product_IsDel]  DEFAULT ((0)),
	[UpdateTime] [datetime] NULL CONSTRAINT [DF_Product_lastModified]  DEFAULT (getdate()),
	[PiNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PiEndTime] [datetime] NULL,
	[gid] [int] NULL,
 CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED 
(
	[ProductID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Product', @level2type=N'COLUMN', @level2name=N'Keyword'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'购买时可使用多少积分' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Product', @level2type=N'COLUMN', @level2name=N'UseScore'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'配送单位倍数增加标识位，1-是，0-否' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Product', @level2type=N'COLUMN', @level2name=N'IsDlvUnit'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'配送单位递增量' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Product', @level2type=N'COLUMN', @level2name=N'DlvUnit'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否提供发票' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Product', @level2type=N'COLUMN', @level2name=N'IsOfferInvoice'

GO
/****** 对象:  Table [dbo].[ProductAsk]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ProductAsk](
	[ProductAskID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Reply] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReplyTime] [datetime] NOT NULL,
	[AdminName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[YesNum] [int] NOT NULL,
	[NotNum] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[MemberName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsToMessage] [tinyint] NOT NULL,
	[SupplierID] [int] NULL CONSTRAINT [DF_ProductAsk_SupplierID]  DEFAULT ((0)),
	[IsHide] [bit] NULL,
	[Operator] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复人ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'ProductAsk', @level2type=N'COLUMN', @level2name=N'Operator'

GO
/****** 对象:  Table [dbo].[ProductField]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ProductField](
	[ProductFieldID] [int] NOT NULL,
	[FieldName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FieldValues] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[AddToAdvSearch] [tinyint] NULL,
	[IsMultiple] [tinyint] NULL,
	[CategoryFieldID] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ProductReview]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ProductReview](
	[ProductReviewID] [int] IDENTITY(1,1) NOT NULL,
	[ProductID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Score] [int] NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[YesNum] [int] NOT NULL,
	[NotNum] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberScore] [int] NOT NULL,
	[ReviewType] [int] NOT NULL,
	[IsToMessage] [tinyint] NOT NULL,
	[OrderID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderTime] [datetime] NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_ProductReview_SupplierID]  DEFAULT ((0)),
	[IsReply] [bit] NULL CONSTRAINT [DF_ProductReview_IsReply]  DEFAULT ((0)),
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[AuditorIP] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditRemark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_ProductReview] PRIMARY KEY CLUSTERED 
(
	[ProductReviewID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Prop]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Prop](
	[pid] [int] IDENTITY(1,1) NOT NULL,
	[pname] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[remark] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[cid] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[parentpid] [int] NULL CONSTRAINT [DF_Prop_parentpid]  DEFAULT ((0)),
	[parentvid] [int] NULL CONSTRAINT [DF_Prop_paretnvid]  DEFAULT ((0)),
	[alias] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_Prop_isalias]  DEFAULT ((0)),
	[iscolorprop] [bit] NULL CONSTRAINT [DF_Prop_iscolorprop]  DEFAULT ((0)),
	[isenumprop] [bit] NULL CONSTRAINT [DF_Prop_isenumprop]  DEFAULT ((0)),
	[isinputprop] [bit] NULL CONSTRAINT [DF_Prop_isinputprop]  DEFAULT ((0)),
	[iskeyprop] [bit] NULL CONSTRAINT [DF_Prop_iskeyprop]  DEFAULT ((0)),
	[isitemprop] [bit] NULL CONSTRAINT [DF_Prop_isitemprop]  DEFAULT ((0)),
	[issaleprop] [bit] NULL CONSTRAINT [DF_Prop_issaleprop]  DEFAULT ((0)),
	[ismust] [bit] NULL CONSTRAINT [DF_Prop_ismust]  DEFAULT ((0)),
	[ismulti] [bit] NULL CONSTRAINT [DF_Prop_ismulti]  DEFAULT ((0)),
	[sort] [int] NULL CONSTRAINT [DF_Prop_sort]  DEFAULT ((1)),
	[status] [int] NULL CONSTRAINT [DF_Prop_status]  DEFAULT ((1)),
	[addtime] [datetime] NULL CONSTRAINT [DF_Prop_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Prop] PRIMARY KEY CLUSTERED 
(
	[pid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[PropValue]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[PropValue](
	[vid] [int] IDENTITY(1,1) NOT NULL,
	[vname] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[cid] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[pid] [int] NOT NULL,
	[pname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[alias] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[isparent] [bit] NULL,
	[remark] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[pic] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[sort] [int] NULL,
	[status] [int] NULL CONSTRAINT [DF_PropValue_status]  DEFAULT ((1)),
	[addtime] [datetime] NULL CONSTRAINT [DF_PropValue_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_PropValue] PRIMARY KEY CLUSTERED 
(
	[vid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[ReceivePay]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ReceivePay](
	[ReceivePayID] [int] IDENTITY(1,1) NOT NULL,
	[OrderNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Bank] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BankAccount] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PayerName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Money] [money] NULL,
	[PayMethod] [int] NULL,
	[PaymentName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[WorkPeople] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PayTime] [datetime] NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_ReceivePay_AddTime]  DEFAULT (getdate()),
	[Status] [int] NULL CONSTRAINT [DF_ReceivePay_Status]  DEFAULT ((1)),
	[Remark] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[IsReceive] [bit] NULL,
	[OutTradeNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PayBank] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[PayBankAccount] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_ReceivePay_1] PRIMARY KEY CLUSTERED 
(
	[ReceivePayID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[ReceiverAddress]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ReceiverAddress](
	[ReceiverAddressID] [int] IDENTITY(1,1) NOT NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverAddress] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverZip] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverPhone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverMobile] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NOT NULL,
	[AddressID] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ReceiverEmail] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL CONSTRAINT [DF_ReceiverAddress_AddTime]  DEFAULT (getdate()),
 CONSTRAINT [PK_ReceiverAddress] PRIMARY KEY CLUSTERED 
(
	[ReceiverAddressID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Repair]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Repair](
	[RepairID] [int] NOT NULL,
	[MemberID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ProductName] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[RepairType] [int] NULL,
	[MemberRemark] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[IsConfirm] [int] NULL,
	[ShippingName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ShippingNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ShippingPrice] [decimal](18, 2) NULL,
	[SenderName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SenderAddress] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SenderPhone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[SenderPostalcode] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AdminAddress] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[AdminPostalcode] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AdminRemark] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[MemberShipStatus] [int] NULL,
	[AdminShipStatus] [int] NULL,
	[AdminShipName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AdminShipNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AdminShipPrice] [decimal](18, 2) NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_Repair_SupplierID]  DEFAULT ((0))
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Review]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Review](
	[ReviewID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[UserName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[HideEmail] [tinyint] NOT NULL,
	[Body] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Reply] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[Score] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ReviewReply]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReviewReply](
	[ReviewReplyID] [int] NOT NULL,
	[ProductReviewID] [int] NOT NULL,
	[MemberID] [int] NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[ReplyTime] [datetime] NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[RltPdts]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RltPdts](
	[RelateID] [int] IDENTITY(1,1) NOT NULL,
	[ProductID] [int] NOT NULL,
	[RltPdtID] [int] NOT NULL,
	[IsCrossJoin] [bit] NULL,
	[sort] [int] NULL,
 CONSTRAINT [PK_RltPdts] PRIMARY KEY CLUSTERED 
(
	[RelateID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否交叉连接' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'RltPdts', @level2type=N'COLUMN', @level2name=N'IsCrossJoin'

GO
/****** 对象:  Table [dbo].[Role]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Role](
	[RoleID] [int] IDENTITY(1,1) NOT NULL,
	[RoleName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_Role_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_Role] PRIMARY KEY CLUSTERED 
(
	[RoleID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[RolePermission]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RolePermission](
	[roleid] [int] NOT NULL,
	[pid] [int] NOT NULL,
	[adduser] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_RolePermission_addtime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[SalesOrder]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SalesOrder](
	[OrderID] [int] NULL,
	[OrderQty] [decimal](18, 2) NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Score]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Score](
	[ScoreID] [int] NOT NULL,
	[ScoreName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ScoreNo] [decimal](18, 0) NOT NULL,
	[ScorePass] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ScoreNum] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[CreateDate] [smalldatetime] NOT NULL,
	[UsedTime] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ExpireDate] [smalldatetime] NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[sendlist]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sendlist](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[mobno] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[msg] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[userid] [nvarchar](11) COLLATE Chinese_PRC_CI_AS NULL,
	[pwd] [nvarchar](6) COLLATE Chinese_PRC_CI_AS NULL,
	[vtag] [int] NULL,
	[sendvtag] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[intime] [smalldatetime] NULL CONSTRAINT [DF_sendlist_intime]  DEFAULT (getdate()),
 CONSTRAINT [PK_sendlist] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SharedLogin]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SharedLogin](
	[ShlonID] [int] NOT NULL,
	[ShlonName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ShlonStatus] [tinyint] NOT NULL,
	[ShlonCallback] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[apiKey] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[apiKeySecret] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ShlonText] [nvarchar](250) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShipCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ShipCart](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_ShipCart_uid]  DEFAULT (newid()),
	[cartid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[shipprice] [money] NULL,
	[memberid] [int] NULL,
	[supplierid] [int] NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_ShipCart_addtime]  DEFAULT (getdate()),
	[remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Shipping]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Shipping](
	[ShippingID] [int] NOT NULL,
	[Name] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Price] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[QueryUrl] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Shipping_QueryUrl]  DEFAULT (''),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_Shipping_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_Shipping] PRIMARY KEY CLUSTERED 
(
	[ShippingID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShippingArea]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ShippingArea](
	[ShippingAreaID] [int] NOT NULL,
	[ShippingAreaNo] [numeric](30, 0) NOT NULL,
	[Name] [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Code] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_ShippingArea_Code]  DEFAULT (''),
	[ParentNo] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_ShippingArea_Description]  DEFAULT (''),
	[Sort] [int] NOT NULL CONSTRAINT [DF_ShippingArea_Sort]  DEFAULT ((0)),
	[Least] [decimal](18, 2) NOT NULL,
	[HaveChild] [tinyint] NOT NULL,
	[Ztds] [int] NOT NULL,
	[Shipps] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsHdfk] [tinyint] NOT NULL,
	[Depth] [int] NULL,
	[Childs] [int] NULL,
	[ParentID] [int] NULL,
	[Status] [int] NULL,
 CONSTRAINT [PK_ShippingArea] PRIMARY KEY CLUSTERED 
(
	[ShippingAreaID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[ShippingExpression]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShippingExpression](
	[ShippingExpressionID] [int] NOT NULL,
	[Name] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Expression] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShippingFree]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShippingFree](
	[ShippingFreeID] [int] NOT NULL,
	[FreeType] [int] NOT NULL,
	[LeastMoney] [decimal](18, 2) NOT NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_ShippingFree_SupplierID]  DEFAULT ((0))
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShippingInvoice]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShippingInvoice](
	[ShippingInvoiceID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ShippingPrice] [decimal](18, 0) NULL,
	[ShippingID] [int] NOT NULL,
	[ShipCompanyName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ShippingNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiverName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Address] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[PostalCode] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[Tel] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Email] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Admin] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[Remark] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Status] [int] NULL,
	[IsReturn] [bit] NULL,
	[ProductID] [int] NULL,
	[ProductName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Quantity] [int] NULL,
 CONSTRAINT [PK_ShippingInvoice] PRIMARY KEY CLUSTERED 
(
	[ShippingInvoiceID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShippingPrice]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShippingPrice](
	[ShippingPriceID] [int] IDENTITY(1,1) NOT NULL,
	[ShippingAreaID] [int] NOT NULL CONSTRAINT [DF_ShippingPrice_ShippingAreaID]  DEFAULT ((1)),
	[ShippingID] [int] NOT NULL,
	[ShippingExpression] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_ShippingPrice_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_ShippingPrice] PRIMARY KEY CLUSTERED 
(
	[ShippingPriceID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShippPay]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShippPay](
	[ShippPayID] [int] NOT NULL,
	[ShippAreaID] [int] NOT NULL CONSTRAINT [DF_ShippPay_ShippAreaID]  DEFAULT ((1)),
	[ShippID] [int] NOT NULL,
	[Fees] [decimal](10, 2) NOT NULL,
	[FeesType] [int] NOT NULL,
 CONSTRAINT [PK_ShippPay] PRIMARY KEY CLUSTERED 
(
	[ShippPayID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0为净手续费，1为总金额的百分比' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'ShippPay', @level2type=N'COLUMN', @level2name=N'FeesType'

GO
/****** 对象:  Table [dbo].[ShopAdmin]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ShopAdmin](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[password] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[flag] [tinyint] NOT NULL CONSTRAINT [DF_ShopAdmin_flag]  DEFAULT ((1)),
	[power] [varchar](1000) COLLATE Chinese_PRC_CI_AS NULL,
	[supplierid] [int] NOT NULL,
	[realname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[phone] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[email] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[status] [int] NULL,
	[addtime] [datetime] NOT NULL CONSTRAINT [DF_ShopAdmin_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_ShopAdmin] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[ShopEval]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ShopEval](
	[ShopEvalID] [int] IDENTITY(1,1) NOT NULL,
	[MemberID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Body] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[IP] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[YesNum] [int] NOT NULL,
	[NotNum] [int] NOT NULL,
	[Status] [int] NOT NULL,
	[MemberName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberScore] [int] NOT NULL,
	[IsToMessage] [tinyint] NOT NULL,
	[OrderID] [int] NULL,
	[OrderNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ReceiveTime] [datetime] NULL,
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_SupplierEval_SupplierID]  DEFAULT ((0)),
	[IsReply] [bit] NULL CONSTRAINT [DF_SupplierEval_IsReply]  DEFAULT ((0)),
	[Auditor] [int] NULL,
	[AuditorName] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[AuditorIP] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditRemark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[pj1] [decimal](18, 2) NULL CONSTRAINT [DF_ShopEval_pj11]  DEFAULT ((0)),
	[pj2] [decimal](18, 2) NULL CONSTRAINT [DF_ShopEval_pj2]  DEFAULT ((0)),
	[pj3] [decimal](18, 2) NULL CONSTRAINT [DF_ShopEval_pj3]  DEFAULT ((0)),
	[pj4] [decimal](18, 2) NULL CONSTRAINT [DF_ShopEval_pj4]  DEFAULT ((0)),
	[pj5] [decimal](18, 2) NULL CONSTRAINT [DF_ShopEval_pj5]  DEFAULT ((0)),
	[pingfen] [decimal](18, 2) NULL,
 CONSTRAINT [PK_SupplierEval] PRIMARY KEY CLUSTERED 
(
	[ShopEvalID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[ShoppingCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShoppingCart](
	[RecordID] [int] IDENTITY(1,1) NOT NULL,
	[CartID] [nvarchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_ShoppingCart_CartID]  DEFAULT (newid()),
	[Quantity] [int] NOT NULL,
	[ProductID] [int] NULL,
	[Items] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_ShoppingCart_Items]  DEFAULT (''),
	[AddTime] [smalldatetime] NOT NULL CONSTRAINT [DF_ShoppingCart_AddTime]  DEFAULT (getdate()),
	[ProductSpecs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL CONSTRAINT [DF_ShoppingCart_ProductSpecs]  DEFAULT (''),
	[GoodsID] [int] NULL CONSTRAINT [DF__ShoppingC__Goods__097532CF]  DEFAULT ((0)),
	[UsedScore] [int] NOT NULL CONSTRAINT [DF_ShoppingCart_UsedScore]  DEFAULT ((0)),
	[Ptype] [int] NOT NULL CONSTRAINT [DF__ShoppingC__Ptype__7247B4B4]  DEFAULT ((1)),
	[GiftScore] [int] NOT NULL CONSTRAINT [DF__ShoppingC__GiftS__733BD8ED]  DEFAULT ((0)),
	[SupplierID] [int] NOT NULL CONSTRAINT [DF_ShoppingCart_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_ShoppingCart] PRIMARY KEY CLUSTERED 
(
	[RecordID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShoppingCartCoupons]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShoppingCartCoupons](
	[ShoppingCartCouponsID] [int] NOT NULL,
	[CartID] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CouponsID] [int] NOT NULL,
	[PromotionID] [int] NOT NULL,
	[CouponsCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[PromotionType] [int] NOT NULL,
	[Discount] [decimal](18, 2) NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[ShoppingCartProductItems]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShoppingCartProductItems](
	[ItemID] [int] NOT NULL,
	[RecordID] [int] NULL,
	[Quantity] [int] NULL,
	[FieldItemID] [int] NULL,
	[AddTime] [smalldatetime] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Spec]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Spec](
	[SpecID] [int] NOT NULL,
	[SpecName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[SpecValue] [nvarchar](2000) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[IsMain] [tinyint] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Storage]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Storage](
	[StorageID] [int] IDENTITY(1,1) NOT NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [int] NOT NULL,
	[Warehousing] [int] NOT NULL,
	[Leave] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Times] [datetime] NOT NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[GoodsID] [int] NOT NULL,
	[Specs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[StorageCheck]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[StorageCheck](
	[StorageCheckID] [int] IDENTITY(1,1) NOT NULL,
	[ProductNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Amount] [int] NOT NULL,
	[Warehousing] [int] NOT NULL,
	[Leave] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[Times] [datetime] NOT NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[Issue] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GoodsID] [int] NOT NULL,
	[Specs] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
 CONSTRAINT [PK_StorageCheck] PRIMARY KEY CLUSTERED 
(
	[StorageCheckID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[StoreTemplate]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[StoreTemplate](
	[tid] [int] IDENTITY(1,1) NOT NULL,
	[tname] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[tfolder] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[sort] [int] NULL,
 CONSTRAINT [PK_StoreTemplate] PRIMARY KEY CLUSTERED 
(
	[tid] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[SubCategory]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SubCategory](
	[cid] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[cname] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[logo] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[parentid] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[depth] [int] NOT NULL,
	[catad] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[childs] [int] NOT NULL CONSTRAINT [DF_SubCategory_childs]  DEFAULT ((0)),
	[pdtnum] [int] NOT NULL CONSTRAINT [DF_SubCategory_pdtnum]  DEFAULT ((0)),
	[pagesize] [int] NULL,
	[sort] [int] NULL,
	[stype] [tinyint] NOT NULL CONSTRAINT [DF_SubCategory_stype]  DEFAULT ((0)),
	[status] [int] NOT NULL CONSTRAINT [DF_SubCategory_status]  DEFAULT ((1)),
	[sid] [int] NOT NULL CONSTRAINT [DF_SubCategory_sid]  DEFAULT ((0)),
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_SubCategory_AddTime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子分类显示方式:0关闭;1展开' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'SubCategory', @level2type=N'COLUMN', @level2name=N'stype'

GO
/****** 对象:  Table [dbo].[Subscriptions]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Subscriptions](
	[SubscriptionsID] [int] NOT NULL,
	[SubscriptionsName] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [text] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SubscriptionsContent]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SubscriptionsContent](
	[SubscriptionsContentID] [int] NOT NULL,
	[SubscriptionsID] [int] NOT NULL,
	[SubscriptionsOptionsID] [int] NOT NULL,
	[SubscriptionsContentName] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Details] [text] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MemberID] [int] NOT NULL,
	[AddTime] [datetime] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SubscriptionsOptions]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SubscriptionsOptions](
	[SubscriptionsOptionsID] [int] NOT NULL,
	[SubscriptionsID] [int] NOT NULL,
	[SubscriptionsOptionsName] [nvarchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Suit]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Suit](
	[SuitID] [int] IDENTITY(1,1) NOT NULL,
	[SuitName] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[MainPdtID] [int] NULL,
	[MainGoodsID] [int] NULL,
	[OldPrice] [decimal](18, 2) NULL,
	[Price] [decimal](18, 2) NULL,
	[Score] [int] NULL CONSTRAINT [DF_Suit_Score]  DEFAULT ((0)),
	[Stock] [int] NULL,
	[Balance] [int] NULL,
	[Remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[BeginTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[Status] [int] NULL CONSTRAINT [DF_Suit_Status]  DEFAULT ((1)),
	[AddTime] [datetime] NULL CONSTRAINT [DF_Suit_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[AuditTime] [datetime] NULL,
	[UpdateUser] [int] NULL,
	[UpdateUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[UpdateTime] [datetime] NULL,
	[SupplierID] [int] NULL CONSTRAINT [DF_Suit_SupplierID]  DEFAULT ((0)),
 CONSTRAINT [PK_Suit] PRIMARY KEY CLUSTERED 
(
	[SuitID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[SuitDetail]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SuitDetail](
	[SuitID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[GoodsID] [int] NULL,
	[OldPrice] [decimal](18, 2) NULL,
	[Price] [decimal](18, 2) NULL,
	[Quantity] [int] NULL CONSTRAINT [DF_SuitDetail_quantity]  DEFAULT ((1)),
	[Sort] [int] NULL CONSTRAINT [DF_SuitDetail_sort]  DEFAULT ((1)),
	[IsMaster] [bit] NULL,
	[Score] [int] NULL CONSTRAINT [DF_SuitDetail_Score]  DEFAULT ((0)),
	[AddTime] [datetime] NULL CONSTRAINT [DF_SuitDetail_AddTime]  DEFAULT (getdate())
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SuitsCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SuitsCart](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_SuitsCart_uid]  DEFAULT (newid()),
	[cartid] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[RecordID] [int] NULL,
	[suitid] [int] NULL,
	[suitname] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[marketprice] [money] NULL,
	[memberprice] [money] NULL,
	[quantity] [int] NULL CONSTRAINT [DF_SuitsCart_quantity]  DEFAULT ((1)),
	[score] [int] NULL CONSTRAINT [DF_SuitsCart_score]  DEFAULT ((0)),
	[SupplierID] [int] NULL CONSTRAINT [DF_SuitsCart_SupplierID]  DEFAULT ((0))
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Supplier]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Supplier](
	[SupplierID] [int] IDENTITY(1,1) NOT NULL,
	[SupplierName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Logo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Description] [varchar](1000) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Address] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Phone] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Contacter] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[Banner] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[ContactInfo] [varchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[Template] [varchar](20) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_Supplier_Template]  DEFAULT ('default'),
	[PdtNum] [int] NOT NULL CONSTRAINT [DF_Supplier_PdtNum]  DEFAULT ((0)),
	[Status] [int] NULL CONSTRAINT [DF_Supplier_Status]  DEFAULT ((0)),
	[UpdateTime] [datetime] NULL,
	[AuditTime] [datetime] NULL,
	[Auditor] [int] NULL,
	[AuditorName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Shut] [int] NOT NULL CONSTRAINT [DF_Supplier_shut]  DEFAULT ((1)),
	[Password] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[ExpireTime] [datetime] NULL,
	[Reviews] [int] NOT NULL CONSTRAINT [DF_Supplier_Reviews]  DEFAULT ((0)),
	[pj1] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Supplier_pj1]  DEFAULT ((0)),
	[pj2] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Supplier_pj2]  DEFAULT ((0)),
	[pj3] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Supplier_pj3]  DEFAULT ((0)),
	[pj4] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Supplier_pj4]  DEFAULT ((0)),
	[pj5] [decimal](18, 2) NOT NULL CONSTRAINT [DF_Supplier_pj5]  DEFAULT ((0)),
	[Title] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Keyword] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Destn] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[BankName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[BankAccount] [varchar](10) COLLATE Chinese_PRC_CI_AS NULL,
	[BankNo] [varchar](30) COLLATE Chinese_PRC_CI_AS NULL,
	[BankAddress] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[CategoryNo] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[BPRate] [float] NULL,
	[PingFen] [decimal](18, 2) NULL,
	[TopAD] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
 CONSTRAINT [PK_Supplier] PRIMARY KEY CLUSTERED 
(
	[SupplierID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开户行名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'BankName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'账户名称' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'BankAccount'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'银行账号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'BankNo'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开户行所属省市区' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'BankAddress'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'经营的大分类编号' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'CategoryNo'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商家首页顶部广告' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Supplier', @level2type=N'COLUMN', @level2name=N'TopAD'

GO
/****** 对象:  Table [dbo].[Survey]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Survey](
	[SurveyID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[Description] [ntext] COLLATE Chinese_PRC_CI_AS NULL,
	[AddTime] [datetime] NULL,
	[Status] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SurveyItem]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SurveyItem](
	[SurveyItemID] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL,
	[SurveyID] [int] NULL,
	[IsMultiChoice] [bit] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SurveyOption]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SurveyOption](
	[SurveyOptionID] [int] NOT NULL,
	[SurveyID] [int] NULL,
	[SurveyItemID] [int] NULL,
	[OptionName] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SurveyResult]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SurveyResult](
	[SurveyResultID] [int] NOT NULL,
	[SurveyID] [int] NULL,
	[SurveyItemID] [int] NULL,
	[SurveyOptionID] [int] NULL,
	[MemberID] [int] NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[SysErrorLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SysErrorLog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[content] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_SysErrorLog_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_SystemErrorLog] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[TagImg]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TagImg](
	[TagImgID] [int] NOT NULL,
	[TagID] [int] NOT NULL,
	[Img] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[TelAsk]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TelAsk](
	[TelAskID] [int] NOT NULL,
	[Title] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TelName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[TelNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL CONSTRAINT [DF_TelAsk_AddTime]  DEFAULT (getdate()),
	[Question] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AdminName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Status] [tinyint] NOT NULL,
 CONSTRAINT [PK_TelAsk] PRIMARY KEY CLUSTERED 
(
	[TelAskID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Template]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Template](
	[TemplateID] [int] NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Folder] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Sort] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[TopSale]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TopSale](
	[TopSaleID] [int] IDENTITY(1,1) NOT NULL,
	[CategoryID] [int] NOT NULL,
	[ProductID] [int] NOT NULL,
	[Sort] [int] NULL,
 CONSTRAINT [PK_TopSale] PRIMARY KEY CLUSTERED 
(
	[TopSaleID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Union]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Union](
	[UnionID] [int] NOT NULL,
	[UnionName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Image] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[Unit]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Unit](
	[UID] [int] NOT NULL,
	[UName] [nvarchar](10) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Sort] [int] NOT NULL,
	[AddTime] [smalldatetime] NOT NULL,
	[Creator] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[UsedScoreInCart]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UsedScoreInCart](
	[uid] [varchar](36) COLLATE Chinese_PRC_CI_AS NULL,
	[cartid] [varchar](36) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[SessionID] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MemberID] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[OrderID] [int] NULL,
	[OrderMoney] [money] NULL,
	[CurrentScore] [money] NULL,
	[UsedScore] [money] NULL,
	[UsedScoreMoney] [money] NULL,
	[status] [int] NULL,
	[addtime] [datetime] NULL,
	[updatetime] [datetime] NULL,
	[remark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Video]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Video](
	[VideoID] [int] NOT NULL,
	[VideoName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[CategoryID] [int] NOT NULL,
	[SrcType] [tinyint] NOT NULL,
	[Url] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[FileName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [ntext] COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AddTime] [datetime] NOT NULL,
	[Status] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[VideoCat]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VideoCat](
	[VideoCatID] [int] NOT NULL,
	[CategoryNo] [numeric](30, 0) NOT NULL,
	[Name] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ParentNo] [numeric](30, 0) NOT NULL,
	[VideoNum] [int] NOT NULL,
	[ParentPath] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Child] [int] NOT NULL,
	[Depth] [int] NOT NULL,
	[Sort] [int] NOT NULL,
	[Status] [int] NOT NULL,
 CONSTRAINT [PK_VideoCat] PRIMARY KEY CLUSTERED 
(
	[VideoCatID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[VoteRecord]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VoteRecord](
	[VoteRecordID] [int] NOT NULL,
	[MemberID] [int] NOT NULL,
	[ObjID] [int] NOT NULL,
	[VoteType] [int] NOT NULL
) ON [PRIMARY]

GO
/****** 对象:  Table [dbo].[XpFinanceLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[XpFinanceLog](
	[SLID] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_XpFinanceLog_SLID]  DEFAULT (newid()),
	[MemberID] [int] NOT NULL,
	[Mobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[PreFinance] [decimal](18, 2) NULL,
	[Finance] [decimal](18, 2) NOT NULL,
	[TotalFinance] [decimal](18, 2) NULL,
	[Flag] [int] NOT NULL,
	[NeedSend] [bit] NULL CONSTRAINT [DF_XpFinanceLog_NeedSend]  DEFAULT ((1)),
	[IsSended] [bit] NULL CONSTRAINT [DF_XpFinanceLog_IsSended]  DEFAULT ((0)),
	[SendTime] [datetime] NULL,
	[FinanceType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FromID] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[FromRemark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[AddIP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GenerateTime] [datetime] NULL CONSTRAINT [DF_XpFinanceLog_GenerateTime]  DEFAULT (getdate()),
	[AddTime] [datetime] NULL CONSTRAINT [DF_XpFinanceLog_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditTime] [datetime] NULL,
	[UpdateSendTime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标志位:-1扣减,0冻结,1增加' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'XpFinanceLog', @level2type=N'COLUMN', @level2name=N'Flag'

GO
/****** 对象:  Table [dbo].[XpScoreLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[XpScoreLog](
	[SLID] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL CONSTRAINT [DF_XpScoreLog_SLID]  DEFAULT (newid()),
	[MemberID] [int] NOT NULL,
	[Mobile] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
	[PreScore] [decimal](18, 2) NULL,
	[Score] [decimal](18, 2) NOT NULL,
	[TotalScore] [decimal](18, 2) NULL,
	[Flag] [int] NOT NULL,
	[NeedSend] [bit] NULL CONSTRAINT [DF_XpScoreLog_NeedSend]  DEFAULT ((1)),
	[IsSended] [bit] NULL CONSTRAINT [DF_XpScoreLog_IsSended]  DEFAULT ((0)),
	[SendTime] [datetime] NULL,
	[ScoreType] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[FromID] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[FromRemark] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Remark] [varchar](200) COLLATE Chinese_PRC_CI_AS NULL,
	[AddIP] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GenerateTime] [datetime] NULL CONSTRAINT [DF_XpScoreLog_GenerateTime]  DEFAULT (getdate()),
	[AddTime] [datetime] NULL CONSTRAINT [DF_XpScoreLog_AddTime]  DEFAULT (getdate()),
	[AddUser] [int] NULL,
	[AddUserName] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[Auditor] [int] NULL,
	[AuditTime] [datetime] NULL,
	[UpdateSendTime] [datetime] NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标志位:-1扣减,0冻结,1增加' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'XpScoreLog', @level2type=N'COLUMN', @level2name=N'Flag'

GO
/****** 对象:  Table [dbo].[XpShopLog]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[XpShopLog](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[memberid] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[url] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[content] [varchar](8000) COLLATE Chinese_PRC_CI_AS NULL,
	[addtime] [datetime] NULL CONSTRAINT [DF_XpShopLog_addtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_XpShopLog] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF
GO
/****** 对象:  Table [dbo].[Ztd]    脚本日期: 04/07/2012 16:13:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Ztd](
	[ZtdID] [int] NOT NULL,
	[ZtdNo] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ZtdName] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Address] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Remark] [nvarchar](200) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[AreaID] [int] NOT NULL
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[Agent]  WITH CHECK ADD  CONSTRAINT [FK_Agent_Member] FOREIGN KEY([MemberID])
REFERENCES [dbo].[Member] ([MemberID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BuyLimit]  WITH NOCHECK ADD  CONSTRAINT [FK_BuyLimit_Category] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[Category] ([CategoryID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BuyLimit] CHECK CONSTRAINT [FK_BuyLimit_Category]
GO
ALTER TABLE [dbo].[Gift]  WITH NOCHECK ADD  CONSTRAINT [FK_Gift_Product] FOREIGN KEY([ProductID])
REFERENCES [dbo].[Product] ([ProductID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Gift] CHECK CONSTRAINT [FK_Gift_Product]
GO
ALTER TABLE [dbo].[Goods]  WITH NOCHECK ADD  CONSTRAINT [FK_Goods_Product] FOREIGN KEY([ProductID])
REFERENCES [dbo].[Product] ([ProductID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Goods] CHECK CONSTRAINT [FK_Goods_Product]
GO
ALTER TABLE [dbo].[OrderProduct]  WITH NOCHECK ADD  CONSTRAINT [FK_OrderProduct_Orders] FOREIGN KEY([OrderID])
REFERENCES [dbo].[Orders] ([OrderID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[OrderProduct] CHECK CONSTRAINT [FK_OrderProduct_Orders]
GO
ALTER TABLE [dbo].[ShippingPrice]  WITH CHECK ADD  CONSTRAINT [FK_ShippingPrice_ShippingArea] FOREIGN KEY([ShippingAreaID])
REFERENCES [dbo].[ShippingArea] ([ShippingAreaID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ShippPay]  WITH NOCHECK ADD  CONSTRAINT [FK_ShippPay_Shipping] FOREIGN KEY([ShippID])
REFERENCES [dbo].[Shipping] ([ShippingID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ShippPay] CHECK CONSTRAINT [FK_ShippPay_Shipping]
GO
ALTER TABLE [dbo].[ShippPay]  WITH CHECK ADD  CONSTRAINT [FK_ShippPay_ShippingArea] FOREIGN KEY([ShippAreaID])
REFERENCES [dbo].[ShippingArea] ([ShippingAreaID])
ON UPDATE CASCADE
ON DELETE CASCADE