CREATE USER [k6] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
CREATE USER [k8] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CollectionFilter](
	[FilterID] [int] IDENTITY(1,1) NOT NULL,
	[FilterName] [nvarchar](255) NULL,
	[FilterType] [tinyint] NULL,
	[BeginTag] [ntext] NULL,
	[EndTag] [ntext] NULL,
	[ReplaceBody] [ntext] NULL,
	[Status] [tinyint] NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_CollectionFilter] PRIMARY KEY CLUSTERED 
(
	[FilterID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'FilterID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过滤名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'FilterName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'替换方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'FilterType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'BeginTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'EndTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'替换内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'ReplaceBody'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionFilter', @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'KS_CollectionFilter', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Class](
	[ClassID] [int] NOT NULL,
	[ChannelID] [smallint] NULL,
	[ClassName] [nvarchar](100) NULL,
	[ClassEname] [nvarchar](150) NULL,
	[ParentID] [int] NULL,
	[Root] [int] NULL,
	[Depth] [tinyint] NULL,
	[OrderID] [int] NULL,
	[ParentIDPath] [varchar](1500) NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[ClassDir] [varchar](255) NULL,
	[ClassType] [tinyint] NULL,
	[UserName] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[ClassTemplate] [nvarchar](255) NULL,
	[ContentTemplate] [nvarchar](255) NULL,
	[Class3GTemplate] [nvarchar](255) NULL,
	[Content3GTemplate] [nvarchar](255) NULL,
	[ShowInTop] [tinyint] NULL,
	[ShowOn3G] [tinyint] NULL,
	[ShowInCir] [tinyint] NULL,
	[AllowPubInfo] [tinyint] NULL,
	[PubFlag] [tinyint] NULL,
	[AllowPubGroupID] [varchar](255) NULL,
	[PubAddMoney] [int] NULL,
	[PubAddPoint] [int] NULL,
	[PubAddScore] [int] NULL,
	[CmtAddScore] [int] NULL,
	[ShareAddScore] [int] NULL,
	[CreateHtmlFlag] [tinyint] NULL,
	[AutoCreateType] [tinyint] NULL,
	[ClassFsoIndex] [varchar](50) NULL,
	[ClassFsoDirRule] [int] NULL,
	[ClassFsoPre] [nvarchar](50) NULL,
	[CreateInfoPath] [varchar](200) NULL,
	[CreateInfoFname] [varchar](150) NULL,
	[ClassDomain] [varchar](100) NULL,
	[DomainBindType] [tinyint] NULL,
	[ClassPurview] [smallint] NULL,
	[DefaultArrGroupID] [nvarchar](255) NULL,
	[DefaultReadPoint] [smallint] NULL,
	[DefaultChargeType] [smallint] NULL,
	[DefaultPitchTime] [smallint] NULL,
	[DefaultReadTimes] [smallint] NULL,
	[DefaultDividePercent] [smallint] NULL,
	[ClassBasicInfo] [ntext] NULL,
	[ClassDefineContent] [ntext] NULL,
	[AdminPurview] [ntext] NULL,
	[InfoNum] [int] NULL,
	[ProSpecialID] [int] NULL,
 CONSTRAINT [PK_KS_Class] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目中文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassEname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ParentID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'级别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'Root'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目深度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'Depth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应的栏目ID集合' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ParentIDPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子栏目数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'Child'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上一个栏目的ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'PrevID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下一个栏目的ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'NextID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成静态的路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创始人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ContentTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机版栏目模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'Class3GTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机版内容模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'Content3GTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'导航栏目标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ShowInTop'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示在3G版本上' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ShowOn3G'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目循环里显示标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ShowInCir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否允许投稿标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'AllowPubInfo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否允许在本栏目下发表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'PubFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许投稿的用户组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'AllowPubGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投稿赠送资金' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'PubAddMoney'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投稿赠送点券' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'PubAddPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投稿赠送积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'PubAddScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论赠送积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'CmtAddScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点分享赠送积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ShareAddScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成HTML标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'CreateHtmlFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动生成的选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'AutoCreateType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目生成首页文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassFsoIndex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目页生成的路径规则' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassFsoDirRule'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目页生成的前缀' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassFsoPre'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容页生成路径规则' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'CreateInfoPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内容页生成文件名规则' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'CreateInfoFname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目绑定的域名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassDomain'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'二级域名绑定方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DomainBindType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目浏览权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassPurview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认允许浏览的用户组ID集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultArrGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认查看本栏目下收费点券数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultReadPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认本栏目下文档的收费方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultChargeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'距离上次收费时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultPitchTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'会员重复阅读次数重新收费' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultReadTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'与投稿者的分成比率' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'DefaultDividePercent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目的配置信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassBasicInfo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目的自定义内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ClassDefineContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'AdminPurview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'本栏目下文档数量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'InfoNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商城绑定的规格组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Class', @level2type=N'COLUMN',@level2name=N'ProSpecialID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Certificate](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[name] [nvarchar](500) NULL,
	[number] [nvarchar](500) NULL,
	[time] [datetime] NULL,
	[company] [nvarchar](500) NULL,
	[picture] [nvarchar](500) NULL,
	[adddate] [datetime] NULL,
	[userid] [int] NULL,
	[schoolid] [int] NULL,
	[schoolname] [varchar](150) NULL,
	[type] [tinyint] NULL,
	[status] [tinyint] NULL,
	[approverpeople] [varchar](50) NULL,
	[approverdate] [datetime] NULL,
	[tcid] [int] NULL,
	[epid] [int] NULL,
	[remark] [text] NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogTemplate](
	[SkinID] [int] IDENTITY(1,1) NOT NULL,
	[TemplateName] [varchar](255) NOT NULL,
	[templateMain] [varchar](255) NULL,
	[TemplateAuthor] [varchar](100) NULL,
	[TemplatePic] [varchar](255) NULL,
	[IsDefault] [tinyint] NOT NULL,
	[groupLevel] [varchar](255) NOT NULL,
	[Sharetag] [int] NULL,
	[UserTag] [int] NULL,
 CONSTRAINT [PK_KS_BLOGTEMPLATE] PRIMARY KEY CLUSTERED 
(
	[SkinID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板ID号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'SkinID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'TemplateName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板目录路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'templateMain'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板作者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'TemplateAuthor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板缩略图' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'TemplatePic'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'组别(个人，企业)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'groupLevel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否共享' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'Sharetag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否用户模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate', @level2type=N'COLUMN',@level2name=N'UserTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'个人空间模板管理' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogTemplate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogStatus](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](255) NULL,
	[UserId] [int] NULL,
	[ArticleTotal] [int] NULL,
	[AlbumTotal] [int] NULL,
	[CorpusTotal] [int] NULL,
	[AskTotal] [int] NULL,
	[MessageTotal] [int] NULL,
 CONSTRAINT [PK_KS_BLOGSTATUS] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'ArticleTotal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'相册总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'AlbumTotal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文集总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'CorpusTotal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问答总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'AskTotal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'留言总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogStatus', @level2type=N'COLUMN',@level2name=N'MessageTotal'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogNav](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NULL,
	[UserName] [varchar](255) NULL,
	[BlogId] [int] NULL,
	[NavName] [varchar](255) NULL,
	[NavId] [int] NULL,
	[NavAlias] [varchar](255) NULL,
	[NavOrderId] [int] NULL,
	[OwnSys] [tinyint] NULL,
	[CustomPage] [text] NULL,
	[Flag] [tinyint] NULL,
	[Marks] [text] NULL,
 CONSTRAINT [PK_KS_BLOGNAV] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'空间用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'空间用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博客ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'BlogId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'导航显示名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'NavName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'导航识别ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'NavId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'导航别名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'NavAlias'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序（越大越靠前）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'NavOrderId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自否是系统自带' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'OwnSys'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自定义页面' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'CustomPage'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'Flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注或者标记' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogNav', @level2type=N'COLUMN',@level2name=N'Marks'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogMessage](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Sender] [varchar](255) NULL,
	[SenderId] [int] NULL,
	[UserId] [varchar](255) NULL,
	[Title] [varchar](500) NULL,
	[Message] [text] NULL,
	[AddDate] [datetime] NULL,
	[Flag] [tinyint] NULL,
	[ReplayDate] [datetime] NULL,
	[Replay] [text] NULL,
 CONSTRAINT [PK_KS_BLOGMESSAGE] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'Sender'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送者ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'SenderId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'留言内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'Message'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'留言时间
   ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'未读/已读' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'Flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'ReplayDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogMessage', @level2type=N'COLUMN',@level2name=N'Replay'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogInfo](
	[BlogID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[UserName] [varchar](255) NULL,
	[TypeID] [int] NULL,
	[ClassID] [int] NULL,
	[Title] [varchar](255) NULL,
	[Tags] [varchar](255) NULL,
	[Contents] [text] NULL,
	[PassWord] [varchar](255) NULL,
	[Hit] [int] NULL,
	[AddDate] [datetime] NULL,
	[Face] [int] NULL,
	[Weather] [varchar](255) NULL,
	[Status] [tinyint] NULL,
	[Best] [tinyint] NULL,
	[Hot] [tinyint] NULL,
	[TopList] [tinyint] NULL,
	[TotalPut] [int] NULL,
	[PhotoUrl] [varchar](255) NULL,
	[SinaWeiboID] [varchar](255) NULL,
	[AffixFile] [varchar](255) NULL,
 CONSTRAINT [PK_KS_BLOGINFO] PRIMARY KEY CLUSTERED 
(
	[BlogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'BlogID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户Name' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'TypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Tags'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Contents'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'查看博文密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'PassWord'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Hit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'增加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户头像' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Face'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'写博文天气心情' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Weather'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @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'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Best'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热门标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'Hot'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'头条标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'TopList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'PhotoUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发布到新浪微博的ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'SinaWeiboID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo', @level2type=N'COLUMN',@level2name=N'AffixFile'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户博客信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogInfo'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogComment](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[LogID] [int] NULL,
	[Title] [varchar](255) NULL,
	[Content] [text] NULL,
	[UserID] [int] NULL,
	[UserName] [varchar](255) NULL,
	[AnounID] [int] NULL,
	[AnounName] [varchar](255) NULL,
	[AddTime] [datetime] NULL,
	[HomePage] [varchar](255) NULL,
	[Replay] [text] NULL,
	[ReplayDate] [datetime] NULL,
	[Flag] [tinyint] NULL,
	[Ext] [varchar](255) NULL,
 CONSTRAINT [PK_KS_BLOGCOMMENT] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'LogID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论人用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'AnounID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论人用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'AnounName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @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'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'HomePage'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'Replay'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'ReplayDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'Flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogComment', @level2type=N'COLUMN',@level2name=N'Ext'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogClassify](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [varchar](50) NOT NULL,
	[OrderID] [int] NOT NULL,
 CONSTRAINT [PK_KS_BLOGCLASSIFY] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClassify', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClassify', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClassify', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'空间分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClassify'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BlogClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [varchar](50) NOT NULL,
	[OrderID] [int] NOT NULL,
	[IsDefault] [tinyint] NULL,
 CONSTRAINT [PK_KS_BLOGCLASS] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClass', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日志分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BlogClass'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Blog](
	[BlogID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[UserName] [varchar](50) NULL,
	[BlogName] [varchar](200) NULL,
	[Domain] [varchar](100) NULL,
	[Logo] [varchar](200) NULL,
	[ClassID] [int] NOT NULL,
	[Descript] [text] NULL,
	[Announce] [text] NULL,
	[ContentLen] [int] NOT NULL,
	[ListBlogNum] [int] NOT NULL,
	[ListLogNum] [int] NOT NULL,
	[ListReplayNum] [int] NOT NULL,
	[ListGuestNum] [int] NOT NULL,
	[TemplateID] [int] NULL,
	[AddDate] [datetime] NULL,
	[Best] [tinyint] NULL,
	[TopList] [tinyint] NULL,
	[Hot] [tinyint] NULL,
	[Status] [tinyint] NOT NULL,
	[Hits] [int] NOT NULL,
	[Banner] [varchar](200) NULL,
	[CollectCount] [int] NULL,
	[ZanCount] [int] NULL,
 CONSTRAINT [PK_KS_BLOG] PRIMARY KEY CLUSTERED 
(
	[BlogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Blog', @level2type=N'COLUMN',@level2name=N'BlogID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户对应ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'空间名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'BlogName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'二级域名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Domain'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户上传LOGO ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Logo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'站点描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'空间公告' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Announce'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'新鲜事，列表每页显示条数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ContentLen'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文，首页显示编数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ListBlogNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'博文，列表显示编数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ListLogNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复，首页显示回复' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ListReplayNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'留言，首页显示留言' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'ListGuestNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'TemplateID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否推荐' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Best'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否置顶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'TopList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否热门' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Hot'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @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'KS_Blog', @level2type=N'COLUMN',@level2name=N'Hits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Banner图片路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog', @level2type=N'COLUMN',@level2name=N'Banner'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户博客配制表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Blog'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSTopic](
	[TopicID] [int] IDENTITY(1,1) NOT NULL,
	[boardId] [int] NULL,
	[UserId] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[UserIP] [varchar](50) NULL,
	[Content] [nvarchar](4000) NULL,
	[PostTable] [nvarchar](30) NULL,
	[AddDate] [datetime] NULL,
	[LastPostTime] [datetime] NULL,
	[verify] [tinyint] NULL,
	[IsTop] [tinyint] NULL,
	[Hits] [int] NULL,
	[PostNum] [int] NULL,
	[Digg] [int] NULL,
	[IsBest] [tinyint] NULL,
	[KeyTags] [varchar](255) NULL,
	[Annex] [varchar](1000) NULL,
	[ReplyText] [nvarchar](4000) NULL,
 CONSTRAINT [PK_KS_BBSTopic] PRIMARY KEY CLUSTERED 
(
	[TopicID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主题ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTopic', @level2type=N'COLUMN',@level2name=N'TopicID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版面ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTopic', @level2type=N'COLUMN',@level2name=N'boardId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTopic', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTopic', @level2type=N'COLUMN',@level2name=N'Annex'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBStest](
	[postid] [int] IDENTITY(1,1) NOT NULL,
	[TopicId] [int] NULL,
	[Content] [nvarchar](2000) NULL,
	[AddDate] [datetime] NULL,
	[Verify] [tinyint] NULL,
	[UserIP] [varchar](50) NULL,
	[UserId] [int] NULL,
	[Annex] [varchar](1000) NULL,
	[UserName] [varchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[postid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSTable](
	[TableId] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](255) NULL,
	[TableName] [varchar](100) NULL,
	[IsDefault] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[IsSys] [tinyint] NULL
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表别名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTable', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSTable', @level2type=N'COLUMN',@level2name=N'TableName'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSRank](
	[RankID] [int] IDENTITY(1,1) NOT NULL,
	[RankName] [nvarchar](50) NULL,
	[IsSys] [tinyint] NULL,
	[Score] [int] NULL,
	[Ico] [nvarchar](50) NULL,
	[TopicNum] [int] NULL,
	[PostNum] [int] NULL,
	[color] [nvarchar](30) NULL
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'达到积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSRank', @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'KS_BBSRank', @level2type=N'COLUMN',@level2name=N'TopicNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSRank', @level2type=N'COLUMN',@level2name=N'PostNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSPost](
	[postid] [int] IDENTITY(1,1) NOT NULL,
	[TopicID] [int] NULL,
	[content] [nvarchar](2000) NULL,
	[addDate] [datetime] NULL,
	[Verify] [tinyint] NULL,
	[UserIP] [nvarchar](100) NULL,
	[UserId] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[Annex] [varchar](1000) NULL
) 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'KS_BBSPost', @level2type=N'COLUMN',@level2name=N'postid'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSMember](
	[MemberId] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[Job] [int] NULL,
	[ClassId] [int] NULL,
	[BoardId] [int] NULL,
	[UserPower] [int] NULL,
	[UserFace] [nvarchar](50) NULL,
 CONSTRAINT [PK_KS_BBSMember] PRIMARY KEY CLUSTERED 
(
	[MemberId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_BBSBoard](
	[BoardID] [int] IDENTITY(1,1) NOT NULL,
	[BoardName] [nvarchar](100) NULL,
	[ParentID] [int] NULL,
	[Root] [int] NULL,
	[Depth] [tinyint] NULL,
	[OrderID] [int] NULL,
	[ParentIDPath] [varchar](300) NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[AddDate] [datetime] NULL,
	[Setting] [ntext] NULL,
	[BoardMaster] [nvarchar](255) NULL,
	[ICO] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[BoardRules] [ntext] NULL,
	[TopicNum] [int] NULL,
	[PostNum] [int] NULL,
	[TodayNum] [int] NULL,
	[LastPost] [nvarchar](500) NULL,
	[Userid] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[Classstatus] [int] NULL,
	[ClassRoomId] [int] NULL,
	[Studentnum] [int] NULL,
	[Hits] [int] NULL,
	[SchoolID] [int] NULL,
	[SchoolName] [nvarchar](255) NULL,
	[price] [money] NULL,
	[isrelated_buy] [int] NULL,
	[vip_ischarge] [int] NULL,
	[vip_price] [money] NULL,
	[vip_discount] [float] NULL,
	[usergroups_free] [text] NULL,
	[is_allowscan] [tinyint] NULL,
	[browse_row] [int] NULL,
	[json] [text] NULL,
 CONSTRAINT [PK_KS_BBSClass] PRIMARY KEY CLUSTERED 
(
	[BoardID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版面名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'BoardName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版主' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'BoardMaster'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版面图标' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'ICO'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版面介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版规' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'BoardRules'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主题数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'TopicNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'PostNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'今日发帖数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_BBSBoard', @level2type=N'COLUMN',@level2name=N'TodayNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Author](
	[AuthorID] [int] IDENTITY(1,1) NOT NULL,
	[AuthorName] [nvarchar](50) NOT NULL,
	[Sex] [nvarchar](2) NULL,
	[Birthday] [nvarchar](100) NULL,
	[WorkUnits] [nvarchar](50) NULL,
	[Address] [nvarchar](50) NULL,
	[Telphone] [nvarchar](50) NULL,
	[ZipCode] [nvarchar](10) NULL,
	[Email] [nvarchar](100) NULL,
	[QQ] [nvarchar](15) NULL,
	[HomePage] [nvarchar](100) NULL,
	[Resume] [ntext] NULL,
	[AddDate] [datetime] NULL,
	[UserName] [nvarchar](50) NULL,
 CONSTRAINT [PK_KS_Author] PRIMARY KEY CLUSTERED 
(
	[AuthorID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Author', @level2type=N'COLUMN',@level2name=N'AuthorID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'作者姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'AuthorName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出生日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Birthday'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'WorkUnits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Telphone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮编' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'ZipCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QQ 号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'QQ'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主页' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'HomePage'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'简介' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'Resume'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Author', @level2type=N'COLUMN',@level2name=N'UserName'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskZJType](
	[TypeID] [int] IDENTITY(1,1) NOT NULL,
	[TypeName] [varchar](100) NULL,
	[OrderID] [int] NULL,
 CONSTRAINT [PK_KS_AskZJType] PRIMARY KEY CLUSTERED 
(
	[TypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJType', @level2type=N'COLUMN',@level2name=N'TypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家类别名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJType', @level2type=N'COLUMN',@level2name=N'TypeName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJType', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskZJ](
	[zjId] [int] IDENTITY(1,1) NOT NULL,
	[userid] [int] NULL,
	[username] [nvarchar](50) NULL,
	[realname] [nvarchar](50) NULL,
	[birthday] [nvarchar](50) NULL,
	[QQ] [nvarchar](50) NULL,
	[UserFace] [nvarchar](255) NULL,
	[Tel] [nvarchar](50) NULL,
	[Address] [nvarchar](255) NULL,
	[ProvinceId] [int] NULL,
	[CityId] [int] NULL,
	[CountyId] [int] NULL,
	[DanWei] [nvarchar](250) NULL,
	[TypeID] [int] NULL,
	[SCFL] [ntext] NULL,
	[Intro] [ntext] NULL,
	[IDCard] [nvarchar](255) NULL,
	[ZYZ] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
	[Verify] [tinyint] NULL,
	[Sex] [nvarchar](50) NULL,
	[Recommend] [tinyint] NULL,
	[AskNum] [int] NULL,
	[BestNum] [int] NULL,
	[ClassID] [int] NULL,
	[istop] [int] NULL,
 CONSTRAINT [PK_KS_AskZJ] PRIMARY KEY CLUSTERED 
(
	[zjId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'zjId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'会员ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'userid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'会员名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'username'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'realname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家出生日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'birthday'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QQ号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'QQ'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家照片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'UserFace'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Tel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'省份ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'ProvinceId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城市ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'CityId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城镇ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'CountyId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'DanWei'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'TypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'擅长分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'SCFL'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'身份证' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'IDCard'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'执业证书' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'ZYZ'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'申请添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'推荐标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'Recommend'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收到的提问总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'AskNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最佳答案总数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'BestNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问答分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'置顶标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskZJ', @level2type=N'COLUMN',@level2name=N'istop'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskTopic](
	[TopicID] [int] IDENTITY(1,1) NOT NULL,
	[classid] [int] NULL,
	[UserId] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[UserIP] [varchar](50) NULL,
	[title] [nvarchar](255) NOT NULL,
	[Content] [ntext] NULL,
	[PostTable] [nvarchar](30) NULL,
	[AddDate] [datetime] NULL,
	[LastPostTime] [datetime] NULL,
	[SolveTime] [datetime] NULL,
	[verify] [tinyint] NULL,
	[IsSolve] [tinyint] NULL,
	[IsTop] [tinyint] NULL,
	[Reward] [int] NULL,
	[Hits] [int] NULL,
	[PostNum] [int] NULL,
	[Recommend] [tinyint] NULL,
	[AskUserID] [int] NULL,
	[BestUserName] [nvarchar](50) NULL,
	[SEOTitle] [nvarchar](255) NULL,
	[SEOKeyWords] [nvarchar](255) NULL,
	[SEODescription] [nvarchar](255) NULL,
	[KeyTags] [nvarchar](255) NULL,
	[titleFontColor] [nvarchar](50) NULL,
	[DefaultPic] [nvarchar](50) NULL,
	[courseid] [int] NULL,
	[Flag] [tinyint] NULL,
	[Imgids] [nvarchar](1000) NULL,
	[Tcid] [int] NULL,
	[ChannelID] [int] NULL,
	[periodid] [int] NULL,
 CONSTRAINT [PK_KS_AskTopic] PRIMARY KEY CLUSTERED 
(
	[TopicID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'TopicID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'classid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题详细内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复数据存放的表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'PostTable'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提问时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后回答的时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'LastPostTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'解决时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'SolveTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否解决 1已解决 2关闭' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'IsSolve'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'置顶标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'IsTop'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'悬赏积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'Reward'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'Hits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回答数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'PostNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否推荐' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'Recommend'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专家ID号，是否向专家提问' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'AskUserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最佳答案的用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'BestUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'SEO 标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'SEOTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'SEO关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'SEOKeyWords'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'SEO 描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'SEODescription'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字Tags' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTopic', @level2type=N'COLUMN',@level2name=N'KeyTags'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskTable](
	[TableId] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](255) NULL,
	[TableName] [varchar](100) NULL,
	[IsDefault] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[IsSys] [tinyint] NULL,
 CONSTRAINT [PK_KS_AskPostTable] PRIMARY KEY CLUSTERED 
(
	[TableId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问答回复表ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'TableId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表别名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据表名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'TableName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否系统自带的表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskTable', @level2type=N'COLUMN',@level2name=N'IsSys'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskRank](
	[RankID] [int] IDENTITY(1,1) NOT NULL,
	[RankName] [nvarchar](50) NULL,
	[IsSys] [tinyint] NULL,
	[Score] [int] NULL,
	[Ico] [nvarchar](50) NULL,
	[QueNum] [int] NULL,
	[AnsNum] [int] NULL,
	[color] [nvarchar](30) NULL,
 CONSTRAINT [PK_KS_AskGrade] PRIMARY KEY CLUSTERED 
(
	[RankID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问答等级ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'RankID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'等级名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'RankName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否系统自带' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'IsSys'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所需积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @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'KS_AskRank', @level2type=N'COLUMN',@level2name=N'Ico'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所需问题数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'QueNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所需回答数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'AnsNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'等级颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskRank', @level2type=N'COLUMN',@level2name=N'color'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskPost](
	[postid] [int] IDENTITY(1,1) NOT NULL,
	[TopicID] [int] NULL,
	[content] [ntext] NULL,
	[addDate] [datetime] NULL,
	[IsBest] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[UserIP] [nvarchar](100) NULL,
	[UserId] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[IsZj] [tinyint] NULL,
	[DefaultPic] [varchar](255) NULL,
	[zhang] [int] NULL,
	[zhangXI] [int] NULL,
 CONSTRAINT [PK_KS_AskPost] PRIMARY KEY CLUSTERED 
(
	[postid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_AskPost', @level2type=N'COLUMN',@level2name=N'postid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'TopicID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回答内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回答时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'addDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否最佳答案' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'IsBest'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'Verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否专家回答' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskPost', @level2type=N'COLUMN',@level2name=N'IsZj'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AskClass](
	[ClassID] [int] NOT NULL,
	[ClassName] [nvarchar](100) NULL,
	[ClassEname] [nvarchar](255) NULL,
	[ParentID] [int] NULL,
	[Root] [int] NULL,
	[Depth] [tinyint] NULL,
	[OrderID] [int] NULL,
	[ParentIDPath] [varchar](4000) NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[ClassDir] [varchar](255) NULL,
	[UserName] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[ShowInTop] [tinyint] NULL,
	[ClassBasicInfo] [ntext] NULL,
	[ClassDefineContent] [ntext] NULL,
	[AdminPurview] [ntext] NULL,
	[QueNum] [int] NULL,
	[AnsNum] [int] NULL,
 CONSTRAINT [PK_KS_AskClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassEname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目父ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ParentID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'级别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'Root'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'深度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'Depth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ID集合' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ParentIDPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子分类数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'Child'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前一个分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'PrevID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下一个分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'NextID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成的路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创始人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否导航显示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ShowInTop'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类的基本配置信息集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassBasicInfo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类的自定义选项集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'ClassDefineContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'AdminPurview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'QueNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回答数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AskClass', @level2type=N'COLUMN',@level2name=N'AnsNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Area](
	[ID] [int] NOT NULL,
	[City] [nvarchar](155) NULL,
	[E_City] [nvarchar](155) NULL,
	[ParentID] [int] NULL,
	[OrderID] [int] NULL,
	[Depth] [int] NULL,
	[Letter] [nvarchar](50) NULL,
	[WebUrl] [nvarchar](100) NULL,
	[WebTitle] [nvarchar](255) NULL,
	[WebLogo] [nvarchar](255) NULL,
	[MetaKeyWord] [nvarchar](255) NULL,
	[MetaDescript] [nvarchar](255) NULL,
	[CopyRight] [nvarchar](255) NULL,
	[ContactMan] [nvarchar](100) NULL,
	[Tel] [nvarchar](100) NULL,
	[Address] [nvarchar](100) NULL,
	[QQ] [nvarchar](100) NULL,
	[Email] [nvarchar](100) NULL,
	[IsShow] [tinyint] NULL,
	[eptotal] [int] NULL,
 CONSTRAINT [PK_KS_Area] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Announce](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NULL,
	[Title] [nvarchar](255) NULL,
	[Content] [ntext] NULL,
	[Author] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[Newest] [int] NULL,
	[ProvinceID] [int] NULL,
	[CityID] [int] NULL,
	[CountyId] [int] NULL,
 CONSTRAINT [PK_KS_Announce] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Announce', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公告所属频道' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公告标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公告内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发者人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'Author'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发布时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最新标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'Newest'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'省份ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'ProvinceID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城市ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'CityID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城镇ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Announce', @level2type=N'COLUMN',@level2name=N'CountyId'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Advertise](
	[adid] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](50) NULL,
	[boardid] [nvarchar](255) NULL,
	[AdType] [int] NULL,
	[ShowType] [int] NULL,
	[LinkUrl] [nvarchar](255) NULL,
	[LinkTips] [nvarchar](255) NULL,
	[LinkTarget] [int] NULL,
	[Content] [ntext] NULL,
	[PicFlashUrl] [nvarchar](255) NULL,
	[Width] [int] NULL,
	[Height] [int] NULL,
	[Clicks] [int] NULL,
	[Views] [int] NULL,
	[TimeLimit] [int] NULL,
	[BeginDate] [datetime] NULL,
	[ExpireDate] [datetime] NULL,
	[Status] [int] NULL,
	[RecordClickIP] [tinyint] NULL,
	[ClickAddScorePerTime] [int] NULL,
	[ClickScore] [int] NULL,
 CONSTRAINT [PK_KS_Advertise] PRIMARY KEY CLUSTERED 
(
	[adid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Advertise', @level2type=N'COLUMN',@level2name=N'adid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告条名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'boardid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'AdType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'ShowType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'LinkUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接提示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'LinkTips'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接目标' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'LinkTarget'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片或是flash地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'PicFlashUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'宽度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Width'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'高度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Height'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Clicks'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Views'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否时间限制标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'TimeLimit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结束时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'ExpireDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位状态标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否记录点击IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'RecordClickIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'隔多长时间点广告加积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'ClickAddScorePerTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击广告条赠送积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Advertise', @level2type=N'COLUMN',@level2name=N'ClickScore'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AdminRole](
	[RoleID] [int] NULL,
	[RoleName] [nvarchar](255) NULL,
	[Remark] [ntext] NULL,
	[OrderID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AdminPlan](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[Content] [ntext] NULL,
	[AddDate] [datetime] NULL,
	[Status] [tinyint] NULL,
	[TipsDays] [int] NULL,
	[IsPub] [int] NULL,
 CONSTRAINT [PK_KS_AdminPlan] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AdminPlan', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作计划内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AdminPlan', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AdminPlan', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态 0未完成 1已完成' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_AdminPlan', @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'KS_AdminPlan', @level2type=N'COLUMN',@level2name=N'TipsDays'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Admin](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[PassWord] [nvarchar](50) NOT NULL,
	[PrUserName] [nvarchar](50) NULL,
	[RealName] [nvarchar](20) NULL,
	[Tel] [nvarchar](15) NULL,
	[Descript] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
	[LastLoginIP] [nvarchar](50) NULL,
	[LastLoginTime] [datetime] NULL,
	[LastLogoutTime] [datetime] NULL,
	[LoginTimes] [int] NULL,
	[Locked] [tinyint] NULL,
	[SysAdmin] [tinyint] NULL,
	[UserType] [int] NULL,
	[PowerList] [ntext] NULL,
	[DocPower] [tinyint] NULL,
	[UserFace] [varchar](255) NULL,
	[Role] [int] NULL,
	[StoreIds] [nvarchar](500) NULL,
	[Salt] [varchar](100) NULL,
	[RndPassword] [varchar](100) NULL,
	[ProvinceId] [int] NULL,
	[CityId] [int] NULL,
	[CountyId] [int] NULL,
	[LastPassWordChangeTime] [datetime] NULL,
	[PassWordEffectiveDays] [int] NULL,
 CONSTRAINT [PK_KS_Admin] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Admin', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'PassWord'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前台用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'PrUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'真实姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'RealName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'Tel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登录IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'LastLoginIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'LastLoginTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登出时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'LastLogoutTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'LoginTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'锁定标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'Locked'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统管理员标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'SysAdmin'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'UserType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'权限值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'PowerList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否可以管理有权限栏目非自己添加的文章' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Admin', @level2type=N'COLUMN',@level2name=N'DocPower'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Adiplist](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[adid] [int] NULL,
	[boardid] [int] NULL,
	[adddate] [datetime] NULL,
	[UserIP] [nvarchar](50) NULL,
	[userName] [varchar](50) NULL,
 CONSTRAINT [PK_KS_Adiplist] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告条ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'adid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'boardid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'adddate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'IP地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adiplist', @level2type=N'COLUMN',@level2name=N'userName'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_ADClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [varchar](250) NULL,
	[Descript] [text] NULL,
	[OrderId] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告分类ＩＤ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ADClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ADClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ADClass', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ADClass', @level2type=N'COLUMN',@level2name=N'OrderId'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Adboard](
	[boardid] [int] IDENTITY(1,1) NOT NULL,
	[BoardName] [nvarchar](50) NULL,
	[AdRate] [int] NULL,
	[FileName] [nvarchar](50) NULL,
	[Maxads] [smallint] NULL,
	[Note] [ntext] NULL,
	[Status] [int] NULL,
	[ClassID] [int] NULL,
 CONSTRAINT [PK_KS_Adboard] PRIMARY KEY CLUSTERED 
(
	[boardid] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Adboard', @level2type=N'COLUMN',@level2name=N'boardid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @level2type=N'COLUMN',@level2name=N'BoardName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位价格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @level2type=N'COLUMN',@level2name=N'AdRate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位JS文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最多广告数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @level2type=N'COLUMN',@level2name=N'Maxads'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @level2type=N'COLUMN',@level2name=N'Note'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位状态 0活动 1暂停' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard', @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'KS_Adboard', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'广告位数据表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Adboard'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_AccessTokens](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](500) NULL,
	[Limits] [varchar](3000) NULL,
	[AccessToken] [varchar](500) NULL,
	[AddDate] [datetime] NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CollectionItem](
	[ItemID] [int] IDENTITY(1,1) NOT NULL,
	[ItemName] [nvarchar](255) NULL,
	[ModelID] [int] NULL,
	[ClassID] [int] NULL,
	[SiteName] [nvarchar](255) NULL,
	[CollectUrl] [nvarchar](255) NULL,
	[Encoding] [nvarchar](100) NULL,
	[Attribute] [nvarchar](50) NULL,
	[CollectOption] [nvarchar](50) NULL,
	[CollectListNum] [int] NULL,
	[CollectInfoNum] [int] NULL,
	[Remark] [nvarchar](255) NULL,
	[PauseTime] [int] NULL,
	[PausePerNum] [int] NULL,
	[ListBeginTag] [ntext] NULL,
	[ListEndTag] [ntext] NULL,
	[LinkBeginTag] [ntext] NULL,
	[LinkEndTag] [ntext] NULL,
	[PageType] [int] NULL,
	[PageUrl] [nvarchar](255) NULL,
	[PageStartID] [int] NULL,
	[PageEndID] [int] NULL,
	[PageListUrl] [ntext] NULL,
	[FieldsRuleXml] [ntext] NULL,
	[AddDate] [smalldatetime] NULL,
	[IsCanCollect] [tinyint] NULL,
	[LastCollectTime] [smalldatetime] NULL,
	[IsCreateHtml] [tinyint] NULL,
	[SpecialID] [nvarchar](255) NULL,
	[ProvinceID] [int] NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
 CONSTRAINT [PK_KS_CollectionItem] PRIMARY KEY CLUSTERED 
(
	[ItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ItemID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ItemName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ModelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集的网站名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'SiteName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'CollectUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对方网站编码方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'Encoding'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'设置默认属性' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'Attribute'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集选项标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'CollectOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'列表深度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'CollectListNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集信息数量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'CollectInfoNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集项目介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'暂停时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PauseTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集多少篇文章暂停' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PausePerNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'列表开始标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ListBeginTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'列表结束标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'ListEndTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接开始标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'LinkBeginTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接结束标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'LinkEndTag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分页方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PageType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分页URL' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PageUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'批量生成的开始ID号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PageStartID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分页批量生成的结束ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'PageEndID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集的字段规则集合' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'FieldsRuleXml'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否可用的采集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'IsCanCollect'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后采集时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'LastCollectTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否生成静态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionItem', @level2type=N'COLUMN',@level2name=N'IsCreateHtml'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Comment](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NULL,
	[ClassID] [int] NULL,
	[InfoID] [int] NULL,
	[UserIP] [nvarchar](20) NULL,
	[Content] [ntext] NULL,
	[Support] [int] NULL,
	[Opposition] [int] NULL,
	[AddDate] [datetime] NULL,
	[Verify] [int] NULL,
	[Anonymous] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[Viewpoint] [int] NULL,
	[Reports] [int] NULL,
	[UserID] [int] NULL,
 CONSTRAINT [PK_KS_Comment] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Comment', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支持票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Support'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'反对票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Opposition'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否匿名评论' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Anonymous'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'立场' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Viewpoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'举报次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'Reports'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Comment', @level2type=N'COLUMN',@level2name=N'UserID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CourseFaceSign](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[UserName] [varchar](100) NULL,
	[CourseID] [int] NULL,
	[CourseName] [varchar](100) NULL,
	[IsSignIn] [int] NULL,
	[SignDate] [datetime] NULL,
	[costype] [tinyint] NULL,
	[mobile] [varchar](50) NULL,
	[realname] [varchar](50) NULL,
	[adddate] [datetime] NULL,
	[json] [text] NULL,
	[paystatus] [int] NULL,
	[status] [tinyint] NULL,
	[ticketid] [int] NULL,
	[orderid] [varchar](50) NULL,
	[studentnum] [int] NULL,
	[remark] [text] NULL,
	[isfull_sign] [tinyint] NULL,
PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CosField](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[FieldModeType] [tinyint] NULL,
	[FieldName] [varchar](200) NULL,
	[FieldOrtherName] [varchar](200) NULL,
	[FieldType] [int] NULL,
	[InputItem] [tinyint] NULL,
	[IsDisabled] [tinyint] NULL,
	[FieldWidth] [int] NULL,
	[DefaultValue] [ntext] NULL,
	[Orderid] [int] NULL,
	[Tips] [ntext] NULL,
	[Toolbar] [varchar](100) NULL,
	[FieldHeight] [int] NULL,
	[AllowFileExt] [varchar](200) NULL,
	[MaxFileSize] [int] NULL,
	[AddDate] [datetime] NULL,
	[Options] [varchar](500) NULL,
	[DrpParentFieldID] [varchar](500) NULL,
	[ArrGroupID] [nvarchar](255) NULL,
 CONSTRAINT [PK_KS_CosField] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_CosField', @level2type=N'COLUMN',@level2name=N'ID'
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'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldModeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字段名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字段别名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldOrtherName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字段类型：1单行文本,2多行文本(不支持HTML)，3多行文本(支持HTML),4下拉选项,5单选框,6复选框,7日期,8数字（Int）,9小数字（Float）,10货币（Money）,11电子邮箱,12图片,13文件,14日期+时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否必填：0是选填，1必填' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'InputItem'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字段状态:0禁用,1正常' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'IsDisabled'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示的宽度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldWidth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默 认 值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'DefaultValue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序字段' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'Orderid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字段录入提示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'Tips'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编辑器类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'Toolbar'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'高度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'FieldHeight'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的文件类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'AllowFileExt'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的文件大小' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'MaxFileSize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'列表选项值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'Options'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属父级字段' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'DrpParentFieldID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组多选' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CosField', @level2type=N'COLUMN',@level2name=N'ArrGroupID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CoseUserzan](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[username] [varchar](50) NULL,
	[tcid] [int] NULL,
	[adddate] [datetime] NULL,
	[ChannelID] [int] NULL,
 CONSTRAINT [PK_KS_Userzan] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CopyFrom](
	[CopyFromID] [int] IDENTITY(1,1) NOT NULL,
	[CopyFromName] [nvarchar](50) NOT NULL,
	[WebSite] [nvarchar](100) NULL,
	[Address] [nvarchar](255) NULL,
	[ContactMan] [nvarchar](50) NULL,
	[Telphone] [nvarchar](50) NULL,
	[Fax] [nvarchar](100) NULL,
	[ZipCode] [nvarchar](10) NULL,
	[Email] [nvarchar](100) NULL,
	[Class] [nvarchar](15) NULL,
	[Intro] [ntext] NULL,
	[AddDate] [datetime] NULL,
	[Status] [tinyint] NULL,
 CONSTRAINT [PK_KS_CopyFrom] PRIMARY KEY CLUSTERED 
(
	[CopyFromID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'CopyFromID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'来源名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'CopyFromName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'WebSite'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'ContactMan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Telphone'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'传真' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Fax'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮编' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'ZipCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'来源分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Class'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CopyFrom', @level2type=N'COLUMN',@level2name=N'Status'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Form](
	[FormID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [nvarchar](255) NULL,
	[FormTemplate] [nvarchar](255) NULL,
	[FieldsXML] [ntext] NULL,
	[TimeLimit] [tinyint] NULL,
	[BeginDate] [datetime] NULL,
	[ExpireDate] [datetime] NULL,
	[LimitIP] [smallint] NULL,
	[UserTF] [tinyint] NULL,
	[UploadUserTF] [tinyint] NULL,
	[AllowGroupID] [nvarchar](100) NULL,
	[UserOnce] [tinyint] NULL,
	[Descript] [ntext] NULL,
	[VerifyTF] [tinyint] NULL,
	[CodeType] [int] NULL,
	[FileName] [nvarchar](100) NULL,
	[Status] [tinyint] NULL,
	[MaxItemID] [int] NULL,
	[IsSendMail] [tinyint] NULL,
	[SuccessTips] [varchar](255) NULL,
	[SuccessUrl] [varchar](255) NULL,
	[MailTemplate] [text] NULL,
	[isReply] [tinyint] NULL,
	[isPay] [tinyint] NULL,
	[PayMoney] [money] NULL,
	[PaySuccessSms] [nvarchar](500) NULL,
	[ShowOnUser] [tinyint] NULL,
	[Score] [int] NULL,
	[setting] [ntext] NULL,
 CONSTRAINT [PK_KS_Form] PRIMARY KEY CLUSTERED 
(
	[FormID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Form', @level2type=N'COLUMN',@level2name=N'FormID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'Subject'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'FormTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单字段集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'FieldsXML'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间限制' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'TimeLimit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'ExpireDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'IP限制' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'LimitIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'UserTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许提交的用户组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'AllowGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每个用户只允许提交一次' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'UserOnce'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'VerifyTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调用方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'CodeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @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'KS_Form', @level2type=N'COLUMN',@level2name=N'MaxItemID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否发邮件通知' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'IsSendMail'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交成功提示信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'SuccessTips'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交成功跳转URL' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'SuccessUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Form', @level2type=N'COLUMN',@level2name=N'MailTemplate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_FieldGroup](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[GroupName] [nvarchar](50) NULL,
	[ChannelID] [int] NULL,
	[OrderID] [int] NULL,
	[IsSys] [int] NULL,
 CONSTRAINT [PK_KS_FieldGroup] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Favorite](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](100) NULL,
	[UserID] [int] NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[AddDate] [datetime] NULL,
	[FtType] [tinyint] NULL,
	[classid] [int] NULL,
 CONSTRAINT [PK_KS_Favorite] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Favorite', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Favorite', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Favorite', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收藏时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Favorite', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Exercisebook](
	[ExerciseId] [int] IDENTITY(1,1) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[ExerciseId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_DownServer](
	[DownID] [int] NOT NULL,
	[ChannelID] [int] NULL,
	[DownloadName] [nvarchar](50) NULL,
	[DownloadPath] [nvarchar](255) NULL,
	[rootid] [int] NULL,
	[orders] [int] NULL,
	[parentid] [int] NULL,
	[child] [int] NULL,
	[IsLock] [tinyint] NOT NULL,
	[IsOuter] [int] NULL,
	[UnionID] [nvarchar](50) NULL,
	[selfont] [nvarchar](255) NULL,
	[AllDownHits] [int] NOT NULL,
	[DayDownHits] [int] NOT NULL,
	[HitsTime] [datetime] NULL,
 CONSTRAINT [PK_KS_DownServer] PRIMARY KEY CLUSTERED 
(
	[DownID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'DownID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下载服务器名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'DownloadName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下载路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'DownloadPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'级别标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'rootid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'orders'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'parentid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子服务器数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'child'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否锁定' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'IsLock'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否外部连接' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'IsOuter'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联盟ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'UnionID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字体' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'selfont'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总下载数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'AllDownHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日下载数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'DayDownHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后下载时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DownServer', @level2type=N'COLUMN',@level2name=N'HitsTime'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_DiggList](
	[DiggID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NOT NULL,
	[InfoID] [int] NOT NULL,
	[LastDiggTime] [datetime] NULL,
	[LastDiggUser] [nvarchar](120) NULL,
	[SupportNum] [int] NOT NULL,
	[AgainstNum] [int] NULL,
 CONSTRAINT [PK_KS_DiggList] PRIMARY KEY CLUSTERED 
(
	[DiggID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后Digg时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'LastDiggTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后Digg的用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'LastDiggUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支持票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'SupportNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'反对票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_DiggList', @level2type=N'COLUMN',@level2name=N'AgainstNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Digg](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NOT NULL,
	[InfoID] [int] NOT NULL,
	[DiggID] [int] NOT NULL,
	[DiggTime] [datetime] NULL,
	[UserName] [nvarchar](100) NULL,
	[UserIP] [nvarchar](100) NULL,
	[DiggType] [int] NULL,
 CONSTRAINT [PK_KS_Digg] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'DIGG ID号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'DiggID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'DiggTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支持或是反对标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Digg', @level2type=N'COLUMN',@level2name=N'DiggType'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Dictionary](
	[KeyID] [int] IDENTITY(1,1) NOT NULL,
	[KeyText] [nvarchar](50) NULL,
	[KeyValue] [ntext] NULL,
	[DefaultValue] [nvarchar](200) NULL,
 CONSTRAINT [PK_KS_Dictionary] PRIMARY KEY CLUSTERED 
(
	[KeyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Dictionary', @level2type=N'COLUMN',@level2name=N'KeyID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'词典KEY名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Dictionary', @level2type=N'COLUMN',@level2name=N'KeyText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'词典KEY值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Dictionary', @level2type=N'COLUMN',@level2name=N'KeyValue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Dictionary', @level2type=N'COLUMN',@level2name=N'DefaultValue'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_InnerLink](
	[LinkID] [int] IDENTITY(1,1) NOT NULL,
	[LinkText] [nvarchar](150) NULL,
	[LinkColor] [nvarchar](50) NULL,
	[LinkUrl] [nvarchar](150) NULL,
	[Opentype] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[Status] [int] NULL,
	[Times] [int] NULL,
 CONSTRAINT [PK_KS_InnerLink] PRIMARY KEY CLUSTERED 
(
	[LinkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'LinkID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接文本' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'LinkText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文本链接颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'LinkColor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'内部链接URL' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'LinkUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'打开方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'Opentype'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InnerLink', @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'KS_InnerLink', @level2type=N'COLUMN',@level2name=N'Times'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_InfoList](
	[InfoID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NOT NULL,
	[ClassID] [int] NOT NULL,
	[Title] [nvarchar](255) NULL,
	[TitleFontColor] [nvarchar](20) NULL,
	[DefaultPic] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[KeyTags] [nvarchar](255) NULL,
	[Hits] [int] NULL,
	[HitsByDay] [int] NULL,
	[HitsByWeek] [int] NULL,
	[HitsByMonth] [int] NULL,
	[LastHitsTime] [datetime] NULL,
	[CopyFrom] [nvarchar](100) NULL,
	[Author] [nvarchar](100) NULL,
	[AddDate] [datetime] NULL,
	[Attribute] [nvarchar](50) NULL,
	[Priority] [int] NULL,
	[Inputer] [nvarchar](100) NULL,
	[RefreshTF] [tinyint] NULL,
	[ShowOn3G] [tinyint] NULL,
	[FileName] [nvarchar](255) NULL,
	[TurnUrl] [nvarchar](255) NULL,
	[ProvinceID] [int] NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
	[Verify] [tinyint] NULL,
	[InfoPurview] [tinyint] NULL,
	[ArrGroupID] [nvarchar](100) NULL,
	[ReadPoint] [money] NULL,
	[ChargeType] [tinyint] NULL,
	[PitchTime] [int] NULL,
	[ReadTimes] [int] NULL,
	[DividePercent] [int] NULL,
	[PKID] [int] NULL,
	[VoteID] [int] NULL,
	[CommentNum] [int] NULL,
	[DelTF] [tinyint] NULL,
	[AttachmentCharge] [int] NULL,
	[AttachmentChargeOnce] [tinyint] NULL,
	[SocialIDs] [varchar](255) NULL,
	[IsTips] [tinyint] NULL,
	[GoodNum] [int] NULL,
	[BadNum] [int] NULL,
	[FavNum] [int] NULL,
	[ShareNum] [int] NULL,
	[ProID] [int] NULL,
 CONSTRAINT [PK_KS_InfoList] PRIMARY KEY CLUSTERED 
(
	[InfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'TitleFontColor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'DefaultPic'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档简介' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字Tags' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'KeyTags'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总点击数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Hits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日点击数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'HitsByDay'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'周点击量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'HitsByWeek'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'月点击量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'HitsByMonth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后点击时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'LastHitsTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'来源' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'CopyFrom'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'作者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Author'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档属性' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Attribute'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档优先级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Priority'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'录入者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Inputer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'RefreshTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'3G版里显示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ShowOn3G'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成的文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'转向链接' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'TurnUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'省份ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ProvinceID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城市ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'CityID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城镇ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'CountyID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'Verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'InfoPurview'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许浏览的用户组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ArrGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览点券数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ReadPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收费方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ChargeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收费间隔时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'PitchTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅读次数后重新收费' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'ReadTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分成比率' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'DividePercent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PKID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'PKID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'VoteID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'CommentNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下载附件费用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'AttachmentCharge'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'多个附件是否重复收费' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'AttachmentChargeOnce'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发布到社交网站返回的ID集，格式为：新浪微博|QQ微博|' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'SocialIDs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投稿是否邮件通知' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_InfoList', @level2type=N'COLUMN',@level2name=N'IsTips'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_GuestBook](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](255) NULL,
	[UserName] [nvarchar](255) NULL,
	[UserID] [int] NULL,
	[UserIP] [varchar](100) NULL,
	[MessageContent] [ntext] NULL,
	[AddDate] [datetime] NULL,
	[ReplyContent] [ntext] NULL,
	[ReplyUser] [nvarchar](200) NULL,
	[ReplyDate] [datetime] NULL,
	[IsReply] [int] NULL,
	[Verify] [int] NULL,
 CONSTRAINT [PK_KS_WeixinOnlineMessage] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_GetUserByGroupIDS]
@GroupIDS varchar(200)
 AS
 Declare @SQL Varchar(1000)
 Set @SQL='SELECT UserID,UserFace,UserName,RealName,Email,Sex,IDCard FROM [KS_USER] WHERE GroupID in'+'('+@GroupIDs+')'+' Order BY UserID Desc'
 Exec (@SQL)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_GetUserByDepartIDS]
@departids varchar(200)
 AS
 Declare @SQL Varchar(1000)
 Set @SQL='SELECT UserID,UserFace,UserName,RealName,Email,Sex,IDCard FROM [KS_USER] WHERE departID in'+'('+@departids+')'+' Order BY UserID Desc'
 Exec (@SQL)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_SpecialR](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SpecialID] [int] NOT NULL,
	[InfoID] [int] NOT NULL,
	[ChannelID] [int] NOT NULL,
 CONSTRAINT [PK_KS_SpecialR] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialR', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialR', @level2type=N'COLUMN',@level2name=N'SpecialID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialR', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialR', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_SpecialClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [nvarchar](200) NOT NULL,
	[ClassEname] [nvarchar](50) NULL,
	[Descript] [ntext] NULL,
	[FsoIndex] [nvarchar](50) NULL,
	[TemplateFile] [nvarchar](255) NULL,
	[AddDate] [smalldatetime] NULL,
	[OrderID] [int] NULL,
	[PhotoUrl] [varchar](255) NULL,
 CONSTRAINT [PK_KS_SpecialClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题分类英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'ClassEname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成的分类首页文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'FsoIndex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类模板文件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'TemplateFile'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_SpecialClass', @level2type=N'COLUMN',@level2name=N'PhotoUrl'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Special](
	[SpecialID] [int] IDENTITY(1,1) NOT NULL,
	[ClassID] [int] NULL,
	[SpecialName] [nvarchar](100) NOT NULL,
	[SpecialEName] [nvarchar](50) NOT NULL,
	[SpecialPic] [nvarchar](255) NULL,
	[TemplateFile] [nvarchar](255) NOT NULL,
	[Descript] [ntext] NULL,
	[Recommend] [int] NULL,
	[AddDate] [smalldatetime] NULL,
	[FsoName] [nvarchar](255) NULL,
	[MetaKeyWord] [ntext] NULL,
	[MetaDescript] [ntext] NULL,
	[UserName] [nvarchar](50) NULL,
	[SpecialDefineContent] [ntext] NULL,
	[SpecialPurView] [int] NULL,
	[ArrGroupID] [nvarchar](100) NULL,
	[ReadPoint] [int] NULL,
	[ChargeType] [int] NULL,
	[PitchTime] [int] NULL,
	[ReadTimes] [int] NULL,
	[Hits] [int] NULL,
 CONSTRAINT [PK_KS_Special] PRIMARY KEY CLUSTERED 
(
	[SpecialID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialEName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialPic'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题绑定的模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'TemplateFile'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专题介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否推荐标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'Recommend'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'生成的文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'FsoName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Seo 关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'MetaKeyWord'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Seo 描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'MetaDescript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'录入员' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自定义内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialDefineContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'SpecialPurView'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许浏览的用户组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'ArrGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览点数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'ReadPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收费方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'ChargeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'间隔时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'PitchTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'ReadTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Special', @level2type=N'COLUMN',@level2name=N'Hits'
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_SJTKModify]
@tmid int=0,
@classid int=0,
@tmtype int=0,
@title nvarchar(255),
@tmnr ntext,
@dajs ntext,
@tmfs float=0,
@answer ntext,
@optionnum int=0,
@orderid int=0,
@isrnd tinyint=0,
@ismedia tinyint=0,
@mediaurl varchar(255),
@mediatxt ntext,
@dajsmedia varchar(255),
@difficulty int=0,
@knowledgeid int=0,
@keywords nvarchar(255)
 AS
 UPDATE KS_SJTK SET 
 [classid]=@classid,
 [tmtype]=@tmtype,
 [title]=@title,
 [tmnr]=@tmnr,
 [dajs]=@dajs,
 [tmfs]=@tmfs,
 [answer]=@answer,
 [optionnum]=@optionnum,
 [orderid]=@orderid,
 [isrnd]=@isrnd,
 [ismedia]=@ismedia,
 [mediaurl]=@mediaurl,
 [mediatxt]=@mediatxt,
 [dajsmedia]=@dajsmedia,
 [difficulty]=@difficulty,
 [knowledgeid]=@knowledgeid,
 [keywords]=@keywords WHERE tmid=@tmid
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_SJTKAdd]
@typeid int=0,
@classid int=0,
@tmtype int=0,
@title nvarchar(255),
@tmnr ntext,
@dajs ntext,
@tmfs float=0,
@answer ntext,
@optionnum int=0,
@orderid int=0,
@isrnd tinyint=0,
@ismedia tinyint=0,
@mediaurl varchar(255),
@mediatxt ntext,
@dajsmedia varchar(255),
@difficulty int=0,
@knowledgeid int=0,
@keywords nvarchar(255)
 AS
Insert Into KS_SJTK([typeid],[classid],[tmtype],[title],[tmnr],[dajs],[tmfs],[answer],[optionnum],[orderid],[isrnd],[ismedia],[mediaurl],[mediatxt],[dajsmedia],[difficulty],[knowledgeid],[keywords])                  
values(@typeid,@classid,@tmtype,@title,@tmnr,@dajs,@tmfs,@answer,@optionnum,@orderid,@isrnd,@ismedia,@mediaurl,@mediatxt,@dajsmedia,@difficulty,@knowledgeid,@keywords)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_SiteCategory](
	[ClassID] [int] NOT NULL,
	[Type] [tinyint] NULL,
	[ClassName] [nvarchar](100) NOT NULL,
	[ClassEname] [nvarchar](255) NULL,
	[ParentID] [int] NULL,
	[Root] [int] NULL,
	[Depth] [tinyint] NULL,
	[OrderID] [int] NULL,
	[ParentIDPath] [varchar](4000) NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[ClassDir] [varchar](255) NULL,
	[UserName] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[ShowInTop] [tinyint] NULL,
	[ClassBasicInfo] [ntext] NULL,
	[ClassDefineContent] [ntext] NULL,
	[AdminPurview] [ntext] NULL,
	[AdminLivePurview] [ntext] NULL,
	[AdminCosPurview] [ntext] NULL,
	[IsHide] [tinyint] NULL,
	[AskId] [int] NULL,
	[Template] [nvarchar](500) NULL,
	[Template3G] [nvarchar](500) NULL,
	[ISTemplate] [int] NULL,
	[ModuleSwitch] [nvarchar](50) NULL,
	[json] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_SignIn](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Username] [nvarchar](255) NULL,
	[UserID] [int] NULL,
	[UserIP] [nvarchar](255) NULL,
	[Status] [int] NULL,
	[Num] [float] NULL,
	[NumType] [int] NULL,
	[Islianxu] [int] NULL,
	[AddDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[Content] [text] NULL,
	[IsDel] [tinyint] NULL,
	[LookPower] [tinyint] NULL,
	[qdxq] [int] NULL,
	[ReportDate] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_SearchView](
	[ModuleType] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NULL,
	[ClassID] [int] NULL,
	[InfoID] [int] NULL,
	[Title] [nvarchar](500) NULL,
	[adddate] [datetime] NULL,
	[readpoint] [money] NULL,
	[defaultPic] [nvarchar](255) NULL,
	[Intro] [text] NULL,
PRIMARY KEY CLUSTERED 
(
	[ModuleType] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_RegisterLog](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[usertype] [int] NULL,
	[username] [nvarchar](50) NULL,
	[password] [nvarchar](50) NULL,
	[sitename] [nvarchar](100) NULL,
	[logo] [nvarchar](255) NULL,
	[descript] [nvarchar](255) NULL,
	[appid] [varchar](25) NULL,
	[appsecret] [varchar](50) NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_RechargeRecords](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[orderid] [nvarchar](50) NULL,
	[username] [nvarchar](50) NULL,
	[adddate] [datetime] NULL,
	[PayTime] [datetime] NULL,
	[status] [int] NULL,
	[paymoney] [money] NULL,
	[realmoney] [money] NULL,
	[remark] [ntext] NULL,
	[platID] [int] NULL,
	[alipaytradeno] [varchar](50) NULL,
	[alipaytradestatus] [varchar](50) NULL,
	[platName] [nvarchar](50) NULL,
	[OrderType] [int] NULL,
	[PackID] [int] NULL,
	[UserInfo] [ntext] NULL,
	[totalmoney] [money] NULL,
	[userid] [int] NULL,
	[SchoolID] [int] NULL,
	[PUserID] [int] NULL,
 CONSTRAINT [PK_KS_RechargeRecords] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'orderid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'username'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'充值时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'adddate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'付款时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'PayTime'
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'KS_RechargeRecords', @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'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'paymoney'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实际入账金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'realmoney'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付平台接口ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'platID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付宝交易流水号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'alipaytradeno'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付宝状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'alipaytradestatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_RechargeRecords', @level2type=N'COLUMN',@level2name=N'platName'
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProLimitBuyDel] 
@ids varchar(1000)
AS
 if (@ids<>'')
  begin
  declare @sql nvarchar(4000)
  set @sql='delete from [KS_ProLimitBuy] Where TaskID in('+@ids+')'
  exec (@sql)
  set @sql='delete from [KS_UploadFiles] Where channelid=100002 and infoid in('+@ids+')'
  exec(@sql)
  set @sql='update [KS_ProductList] Set IsLimitBuy=0,LimitBuyTaskID=0,LimitBuyPrice=0,LimitBuyAmount=0 Where LimitBuyTaskID in('+@ids+')'
  exec (@sql)
 end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProLimtBuyStatus] 
 @taskIds nvarchar(4000)
AS
  if @taskIds=''
  return null
 else
  begin

    declare @sql nvarchar(4000),@taskid int,@status int
    set @sql='declare rs cursor for select taskid,status From KS_ProLimitBuy Where taskid in('+@taskIds+')'
    exec (@sql)
     open rs
     fetch next from rs
     into @taskid,@status
     while @@fetch_status=0
     begin
         if @status=1
           update KS_ProLimitBuy Set Status=0 Where taskid=@taskid
        else
          update KS_ProLimitBuy Set Status=1 Where taskid=@taskid
         fetch next from rs
         into @taskid,@status
     end
     close rs
     deallocate rs
 end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProLimitBuyUpdate]
@taskname nvarchar(255),
@tasktype int=0,
@limitbuybegintime datetime,
@limitbuyendtime datetime,
@limitbuypaytime int=0,
@intro ntext,
@status   tinyint=0,
@templatefile varchar(255),
@recommend tinyint=0,
@photourl varchar(255),
@jgrange varchar(255),
@taskid  int=0,
@provinceid int=0,
@cityid int=0,
@countyid int=0,
@isrepeat int output
 AS
  If  exists(select top 1 *  From KS_ProLimitBuy Where TaskName=@taskname And taskID<>@taskid)
  begin
   select @isrepeat=-2 /*重名*/
   return null
  end 
 Else
  Update [KS_ProLimitBuy] Set
   TaskName=@taskname,
   TaskType=@tasktype,
   LimitBuyBeginTime=@limitbuybegintime,
   LimitBuyEndTime=@limitbuyendtime,
   LimitBuyPayTime=@limitbuypaytime,
   Intro=@intro,
  TemplateFile=@templatefile,
   recommend=@recommend,
   photourl=@photourl,
  jgrange=@jgrange,
   Status=@status,
   ProvinceID=@provinceid,
   CityID=@cityid,
   CountyID=@countyid
  Where taskid=@taskid
 select @isrepeat=0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProLimitBuyCheckPayEndTime]
 AS
Select i.Infoid,i.Num,i.OrderID,o.paytime,L.LimitBuyPayTime,O.status,O.InputTime From (KS_ProOrderItem i inner join ks_ProOrder o on i.orderid=o.orderid) inner join KS_ProLimitBuy L on I.LimitBuyTaskID=L.TaskID Where (L.LimitBuyPayTime)<>0 and i.IsLimitBuy<>0 and o.status=0 and o.MoneyReceipt=0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProLimitBuyAdd]
@taskname nvarchar(255),
@tasktype int=0,
@limitbuybegintime datetime,
@limitbuyendtime datetime,
@limitbuypaytime int=0,
@intro ntext,
@adddate datetime,
@status   tinyint=0,
@templatefile varchar(255),
@recommend tinyint=0,
@photourl varchar(200),
@jgrange varchar(255),
@provinceid int=0,
@cityid int=0,
@countyid int=0,
@isrepeat int output
 AS
  if exists(select top 1 taskid from [KS_ProLimitBuy] where taskname=@taskname)
   begin
    select @isrepeat=-2
   return null
   end
 else
   begin
  Insert Into [KS_ProLimitBuy](TaskName,TaskType,LimitBuyBeginTime,LimitBuyEndTime,LimitBuyPayTime,Intro,Status,AddDate,TemplateFile,Recommend,PhotoUrl,JGRange,ProvinceID,CityID,CountyID)
  values(@taskname,@tasktype,@limitbuybegintime,@limitbuyendtime,@limitbuypaytime,@intro,@status,@adddate,@templatefile,@recommend,@photoUrl,@jgrange,@provinceid,@cityid,@countyid)
   select @isrepeat=0
  end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProOrderDelete]
@OrderID varchar(100)
 AS
 DELETE FROM [KS_ProOrderBundleSale] Where CartID in(Select ItemID From [KS_ProOrderItem] Where OrderID=@OrderID)
 DELETE FROM [KS_ProOrderItem] Where OrderID=@OrderID
 DELETE FROM [KS_ProOrder] Where OrderID=@OrderID
 DELETE FROM [KS_ProOrderLog] Where OrderID=@OrderID
 DELETE FROM [KS_ProGroupBuyConsumer]  Where OrderID=@OrderID
 DELETE FROM [KS_ProOrderService]  Where OrderID=@OrderID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProGetProFromLimitBuy] 
@NUM INT=0,
@TaskID INT=0
AS
 DECLARE @SQL Nvarchar(2200)
 Set @SQL='SELECT  top '+Cast(@num as varchar(20))+'  I.Title,I.LinkUrl,i.DefaultPic,I.Price_market,I.Price_member,I.Price,I.LimitBuyPrice,I.LimitBuyAmount,I.Unit,L.LimitBuyBeginTime,L.LimitBuyEndTime,L.TaskType FROM KS_ProductList I Inner Join KS_ProLimitBuy L ON I.LimitBuyTaskID=L.Taskid Where L.Status=1 and L.taskid='+Cast(@TaskID as varchar(20))+' Order BY I.InfoID Desc'
 Exec (@SQL)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ShopProImages] 
 @ID int=0
AS
 SELECT TOP 500  a.title,b.* FROM KS_ProductList A Left Join KS_ProImages B On A.InfoID=B.InfoID WHERE a.InfoID=@ID order by orderid,id
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ShopItemModify]
  @classid int,
  @brandid int,
  @proid nvarchar(200),
  @title nvarchar(255),
  @titlefontcolor varchar(50),
  @producttype int,
  @barcode nvarchar(150),
  @unit nvarchar(50),
  @weight float,
  @intro nvarchar(255),
  @defaultpic nvarchar(255),
  @bigphoto nvarchar(255),
  @keytags nvarchar(255),
  @hits int,
  @adddate datetime,
  @attribute nvarchar(255),
  @priority nvarchar(100),
  @inputer nvarchar(100),
  @verify int,
  @attributecart nvarchar(255),
  @price money=0,
  @price_member money=0,
  @price_cost money=0,
  @score int=0,
  @groupprice int =0,
  @ischangebuy int =0,
  @changebuyneedprice money=0,
  @changebuypresentprice money=0,
  @islimitbuy int=0,
  @limitbuytaskid int=0,
  @limitbuyprice money=0,
  @limitbuyamount int=0,
  @limitbegindate datetime,
  @limitenddate datetime,
  @taxtf tinyint=0,
  @tax float=0,
  @amount int =0,
  @alarmnum int =0,
  @hassold int =0,
  @minordernum int=0,
  @maxordernum int =0,
  @attachmentcharge int=0,
  @attachmentchargeonce int=0,
  @turnurl varchar(255),
  @isscorechange int=0,
  @changescore int=0,
  @showon3g int=0,
  @paytype int=0,
  @payid int=0,
  @frontprice money=0,
  @isbookcode int=0,
  @bookcodetypeid int=0,
  @limitcitynum int=0,
  @limitbuytype int=0,
  @limitbuynum int=0,
  @downurl varchar(255),
  @ispromotions int=0,
  @isgrouprate int=0,
  @provinceid int=0,
  @cityid int=0,
  @countyid int=0,
  @freightfree int=0,
  @allowbuyflag int=0,
  @arrgroupid nvarchar(255),
  @infoid int=0
 AS
  UPDATE [KS_ProductList]
  Set classid=@classid,
  brandid=@brandid,
  proid=@proid,
  title=@title,
  titlefontcolor=@titlefontcolor,
  producttype=@producttype,
  barcode=@barcode,
  unit=@unit,
  weight=@weight,
  intro=@intro,
  defaultpic=@defaultpic,
  bigphoto=@bigphoto,
  keytags=@keytags, 
  hits=@hits,
  adddate=@adddate,
  attribute=@attribute,
  priority=@priority,
  inputer=@inputer,
  verify=@verify,
  attributecart=@attributecart,
  price=@price,
  price_member=@price_member,
  price_cost=@price_cost,
  score=@score,
  groupprice=@groupprice,
  ischangebuy=@ischangebuy,
  changebuyneedprice=@changebuyneedprice,
  changebuypresentprice=@changebuypresentprice,
  islimitbuy=@islimitbuy,
  limitbuytaskid=@limitbuytaskid,
  limitbuyprice=@limitbuyprice,
  limitbuyamount=@limitbuyamount,
  taxtf=@taxtf,
  tax=@tax,
  amount=@amount,
  alarmnum=@alarmnum,
  hassold=@hassold,
  minordernum=@minordernum,
  maxordernum=@maxordernum,
  attachmentcharge=@attachmentcharge,
  attachmentchargeOnce=@attachmentchargeonce,
  turnurl=@turnurl,
  isscorechange=@isscorechange,
  changescore=@changescore,
  showon3g=@showon3g,
  paytype=@paytype,
  payid=@payid,
  frontprice=@frontprice,
  limitbegindate=@limitbegindate,
  limitenddate=@limitenddate,
  isbookcode=@isbookcode,
  bookcodetypeid=@bookcodetypeid,
  limitcitynum=@limitcitynum,
 limitbuytype=@limitbuytype,
 limitbuynum=@limitbuynum,
  downurl=@downurl,
  ispromotions=@ispromotions,
  isgrouprate=@isgrouprate,
  provinceid=@provinceid,
  cityid=@cityid,
  countyid=@countyid,
  freightfree=@freightfree,
  allowbuyflag=@allowbuyflag,
  arrgroupid=@arrgroupid
  Where InfoID=@infoid
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ShopItemAdd]
  @channelid int,
  @classid int,
  @brandid int=0,
  @title nvarchar(255),
  @titlefontcolor nvarchar(50),
  @producttype int,
  @proid nvarchar(100),
  @barcode nvarchar(150),
  @unit nvarchar(50),
  @weight float,
  @intro nvarchar(255),
  @defaultpic nvarchar(255),
  @bigphoto nvarchar(255),
  @keytags nvarchar(255),
  @hits int,
  @adddate datetime,
  @attribute nvarchar(255),
  @priority nvarchar(100),
  @inputer nvarchar(200),
  @verify int,
  @refreshtf int,
  @filename nvarchar(255),
  @attributecart nvarchar(255),
  @price money=0,
  @price_member money=0,
  @price_cost money=0,
  @score money=0,
  @groupprice int =0,
  @ischangebuy int =0,
  @changebuyneedprice money=0,
  @changebuypresentprice money=0,
  @islimitbuy int=0,
  @limitbuytaskid int=0,
  @limitbuyprice money=0,
  @limitbuyamount int=0,
  @taxtf tinyint=0,
  @tax float=0,
  @amount int =0,
  @alarmnum int =0,
  @hassold int =0,
  @minordernum int=0,
  @maxordernum int =0,
  @attachmentcharge int=0,
  @attachmentchargeonce int=0,
  @turnurl varchar(255),
  @isscorechange int=0,
  @changescore int=0,
  @showon3g int=0,
  @paytype int=0,
  @payid int=0,
  @frontprice money=0,
  @limitbegindate datetime,
  @limitenddate datetime,
  @isbookcode int=0,
  @bookcodetypeid int=0,
  @limitcitynum int=0,
  @limitbuytype int=0,
  @limitbuynum int=0,
  @downurl nvarchar(255),
  @ispromotions int=0,
  @isgrouprate int=0,
  @provinceid int=0,
  @cityid int=0,
  @countyid int=0,
  @freightfree int=0,
  @allowbuyflag int=0,
  @arrgroupid nvarchar(255),
  @itemid int output
 AS
  INSERT INTO [KS_ProductList]

(channelid,classid,brandid,title,titlefontcolor,producttype,proid,barcode,unit,weight,intro,defaultpic,bigphoto,keytags,hits,adddate,attribute,priority,inputer,verify,refreshtf,filename,attributecart,price,price_member,price_cost,score,groupprice,ischangebuy,changebuyneedprice,changebuypresentprice,islimitbuy,limitbuytaskid,limitbuyprice,limitbuyamount,taxtf,tax,amount,alarmnum,hassold,minordernum,maxordernum,attachmentcharge,attachmentchargeonce,turnurl,isscorechange,changescore,showon3g,paytype,payid,frontprice,limitbegindate,limitenddate,isbookcode,bookcodetypeid,limitcitynum,limitbuytype,limitbuynum,downurl,ispromotions,isgrouprate,provinceid,cityid,countyid,freightfree,allowbuyflag,arrgroupid) 
  VALUES

(@channelid,@classid,@brandid,@title,@titlefontcolor,@producttype,@proid,@barcode,@unit,@weight,@intro,@defaultpic,@bigphoto,@keytags,@hits,@adddate,@attribute,@priority,@inputer,@verify,@refreshtf,@filename,@attributecart,@price,@price_member,@price_cost,@score,@groupprice,@ischangebuy,@changebuyneedprice,@changebuypresentprice,@islimitbuy,@limitbuytaskid,@limitbuyprice,@limitbuyamount,@taxtf,@tax,@amount,@alarmnum,@hassold,@minordernum,@maxordernum,@attachmentcharge,@attachmentchargeonce,@turnurl,@isscorechange,@changescore,@showon3g,@paytype,@payid,@frontprice,@limitbegindate,@limitenddate,@isbookcode,@bookcodetypeid,@limitcitynum,@limitbuytype,@limitbuynum,@downurl,@ispromotions,@isgrouprate,@provinceid,@cityid,@countyid,@freightfree,@allowbuyflag,@arrgroupid)
select @itemid=@@identity
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProGetProFromOrderItem]
@OrderID varchar(100)
AS
Select top 100  TurnUrl,I.FileName,I.ProID,I.InfoID,I.ClassID,I.InfoID,I.ChannelID,I.Score,I.Price_Member,I.Title as ITitle,I.DefaultPic,I.Price as Price_Market,I.Weight,I.Unit,I.AttributeCart,I.IsPromotions,I.ProductType,O.* From KS_ProOrderItem o left join KS_ProductList i on o.infoid=i.infoid Where O.OrderID=@OrderID order by O.ItemID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProGetProFromCartToBuy] 
@userName nvarchar(50)
AS
select top 100 C.*,i.amount,i.channelid,i.classid,i.turnurl,i.filename,i.title,i.DefaultPic,i.IsGroupRate,i.groupprice,i.attributecart,i.price as price_market,i.price_member,i.price_cost,i.taxtf,i.tax,i.Score,I.IsLimitBuy,I.LimitBuyPrice,I.LimitBuyAmount,i.IsScoreChange,I.ChangeScore,I.PayType,i.payid,I.FrontPrice,i.LimitBeginDate,i.LimitEndDate,i.IsBookCode,i.BookCodeTypeID,i.LimitCityNum,i.producttype,i.IsPromotions,i.limitbuytype,i.limitbuynum,i.verify FROM [KS_ProShoppingCart] C Inner Join [KS_ProductList] I ON C.InfoID=I.InfoID Where C.num>0 and C.Flag=0 and C.UserName=@userName and c.isToPay=1 order by C.isChangeBuy ,C.IsBundleSale,C.CartID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProGetProFromCart] 
@userName nvarchar(50)
AS
select top 100 C.*,i.amount,i.channelid,i.classid,i.turnurl,i.filename,i.title,i.DefaultPic,i.IsGroupRate,i.groupprice,i.attributecart,i.price as price_market,i.price_member,i.price_cost,i.taxtf,i.tax,i.Score,I.IsLimitBuy,I.LimitBuyPrice,I.LimitBuyAmount,i.IsScoreChange,I.ChangeScore,I.PayType,i.payid,I.FrontPrice,i.LimitBeginDate,i.LimitEndDate,i.IsBookCode,i.BookCodeTypeID,i.LimitCityNum,i.producttype,i.IsPromotions,i.limitbuytype,i.limitbuynum,i.verify FROM [KS_ProShoppingCart] C Inner Join [KS_ProductList] I ON C.InfoID=I.InfoID Where C.num>0 and C.Flag=0 and C.UserName=@userName order by C.isChangeBuy ,C.IsBundleSale,C.CartID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProUpdateCouponUser]
@CouponUserId int,
@OrderId varchar(100),
@AllowOffsetMoney money=0,
@UserName nvarchar(100),
@Note Ntext
 AS
  UPDATE [KS_ProCouponUser] Set
    UseFlag=1,
    UserName=@UserName,
    UseTime=GetDate(),
    OrderID=@OrderID,
    [Note]=@Note,
    AvailableMoney=AvailableMoney-@AllowOffsetMoney
  WHERE CouponUserId=@CouponUserId
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProCouponUserAdd]
@CouponID int=0,
@couponNum varchar(100),
@userName varchar(100),
@AvailableMoney money=0,
@mailTF tinyint=0
 AS

 INSERT Into [KS_ProCouponUser](
   CouponID,CouponNum,UserName,AvailableMoney,MailTF,UseFlag,OrderID,AddDate
) values(
  @CouponID,@CouponNum,@UserName,@AvailableMoney,@MailTF,0,'',GetDate()
)
 return @@identity
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProGetCouponByCouponNum]
@CouponNum varchar(50)
 AS
SELECT Top 1 A.FaceValue,A.MinAmount,A.MaxDiscount,b.AvailableMoney,A.BeginDate,a.EndDate,a.Status,B.CouponUserID,B.Note,A.CouponType,B.UserName,A.Couponname,A.LimitType,A.LimitClassIDs,A.LimitProIds,A.RangeType FROM KS_ProCoupon A Inner Join KS_ProCouponUser B On A.CouponID=B.CouponID Where B.CouponNum=@CouponNum
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProCouponStatus] 
 @couponIds nvarchar(4000)
AS
  if @couponIds=''
  return null
 else
  begin

    declare @sql nvarchar(4000),@couponid int,@status int
    set @sql='declare rs cursor for select couponid,status From KS_ProCoupon Where couponid in('+@couponIds+')'
    exec (@sql)
     open rs
     fetch next from rs
     into @couponid,@status
     while @@fetch_status=0
     begin
         if @status=1
           update KS_ProCoupon Set Status=0 Where couponid=@couponid
        else
          update KS_ProCoupon Set Status=1 Where couponid=@couponid
         fetch next from rs
         into @couponid,@status
     end
     close rs
     deallocate rs
 end
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_ProCommentReply](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[content] [text] NULL,
	[adddate] [datetime] NULL,
	[status] [tinyint] NULL,
	[username] [varchar](50) NULL,
	[userip] [varchar](50) NULL,
	[cmtid] [int] NULL,
	[userid] [int] NULL,
 CONSTRAINT [PK_KS_ProCommentReply] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复评论内容
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'adddate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @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'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'username'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'userip'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评价ID号
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'cmtid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProCommentReply', @level2type=N'COLUMN',@level2name=N'userid'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_ProComment](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[OrderId] [varchar](50) NULL,
	[ProID] [int] NULL,
	[ClassId] [int] NULL,
	[UserName] [varchar](50) NULL,
	[UserID] [int] NULL,
	[UserIP] [varchar](50) NULL,
	[AddDate] [datetime] NULL,
	[Content] [text] NULL,
	[StarNum] [int] NULL,
	[CmtType] [tinyint] NULL,
	[Support] [int] NULL,
	[CmtNum] [int] NULL,
	[BuyDate] [datetime] NULL,
	[ProAttr] [varchar](255) NULL,
	[Status] [tinyint] NULL,
	[PhotoUrls] [text] NULL,
	[AddContent] [text] NULL,
	[AddContentTime] [datetime] NULL,
	[orderType] [int] NULL,
	[ReplyContent] [ntext] NULL,
	[ReplyUser] [ntext] NULL,
	[ReplyDate] [datetime] NULL,
	[IsReply] [tinyint] NULL,
	[ChannelID] [int] NULL,
	[schoolid] [int] NULL,
	[infoUserId] [int] NULL,
	[flag] [int] NULL,
	[recommend] [int] NULL,
 CONSTRAINT [PK_KS_ProComment] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动编号
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'OrderId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商品ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ProID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应的分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ClassId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论者用户ID
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论人IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发表时间
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发表内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'星星数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'StarNum'
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'KS_ProComment', @level2type=N'COLUMN',@level2name=N'CmtType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支持数
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'Support'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复数
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'CmtNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'购买日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'BuyDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'购买的商品属性
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ProAttr'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @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'KS_ProComment', @level2type=N'COLUMN',@level2name=N'PhotoUrls'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'追加评价' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'AddContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'追回评价时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'AddContentTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0普通订单 1团购订单,3一元购，2商城的拼团' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'orderType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ReplyContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ReplyUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'回复日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ReplyDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否回复' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'IsReply'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'10001班级，10002课程，10003教师,4商城' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'机构ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'schoolid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论主体对应的发布者UserID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'infoUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'4商城,10001班级，10002课程，10003教师' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ProComment', @level2type=N'COLUMN',@level2name=N'flag'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProShoppingCartAdd] 
 @infoId int=0,
  @price money=0,
  @num int=0,
  @username nvarchar(255),
  @adddate datetime,
  @IsAnonymous tinyint=0,
  @IsChangeBuy tinyint=0,
  @isBundleSale tinyint=0,
  @isLimitBuy tinyint=0,
  @limitBuyTaskId int=0,
  @attrid int=0,
  @flag int=0,
  @cityid int=0,
  @bookcode varchar(100),
  @business nvarchar(100),
  @cartid int out,
  @minnum int=0 out,
  @maxnum int=0 out
AS
 DECLARE @MinOrderNum int,@MaxOrderNum int,@Amount int
 Select top 1 @MinOrderNum=MinOrderNum,@MaxOrderNum=MaxOrderNum,@Amount=Amount From [KS_ProductList] Where InfoID=@InfoID
 If (@MinOrderNum<>0 And @num<@MinOrderNum and @IsChangeBuy=0)
  begin
   select @cartid=-3
   select @minnum=@minordernum
   select @maxnum=@maxordernum
  return
  end
 Else If(@MaxOrderNum<>0 And @Num>@MaxOrderNum and @IsChangeBuy=0)
  Begin
    select @cartid=-4
    select @minnum=@minordernum
    select @maxnum=@maxordernum
   return
  End 
 Else
  Begin
     if @isbundlesale=1 
      Begin
        Select @CartID=CartID From [KS_ProShoppingCart] Where UserName=@UserName and isBundleSale=1
        Delete From [KS_ProShoppingCart] Where UserName=@UserName and isBundleSale=1
        Delete From [KS_ProBundleSelect] Where CartID=@CartID
      End
     if not exists(select top 1 cartid from [KS_ProShoppingCart] where isBundleSale=@isbundlesale and infoid=@infoid and attrid=@attrid and username=@username)
      Begin
      INSERT INTO [KS_ProShoppingCart] 
      (InfoID,Price,Num,UserName,IsAnonymous,IsChangeBuy,IsBundleSale,IsLimitBuy,LimitBuyTaskID,AddDate,AttrID,Flag,CityID,BookCode,Business)
      Values(@InfoID,@Price,@Num,@UserName,@IsAnonymous,@IsChangeBuy,@IsBundleSale,@IsLimitBuy,@LimitBuyTaskID,@AddDate,@attrid,@flag,@cityid,@bookcode,@business)
      select @cartid=@@identity
     End 
    Else
	  Begin
	   UPDATE [KS_ProShoppingCart] SET Num=@Num where infoid=@infoid and attrid=@attrid and username=@username
     select @cartid=-2
	  End
 End
 select @minnum=0
 select @maxnum=0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProOrderAddBundleSale] 
@infoID int=0,
@cartId int=0
AS
 DECLARE @ItemId int
 Select @ItemId=max(itemid) From KS_ProOrderItem
 insert into [KS_ProOrderBundleSale] Select CartId,InfoID,Title,Price,Num,getdate() From KS_ProBundleSelect Where cartId=@cartID
 Update  [KS_ProOrderBundleSale] Set CartId=@ItemId Where CartId=@cartId
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ProGetProFromOrderBundleSale] 
@infoId int=0,
@cartId int=0
AS
Select I.Title,I.Weight,I.Price as Price_Market,I.Amount,I.Score,b.attrid From KS_ProOrderBundleSale S  inner join KS_ProBundleSale B on S.InfoID=b.id left Join KS_ProductList I ON b.kbInfoID=I.InfoID Where S.CartID=@CartID

--Select I.Title,I.Weight,I.Price as Price_Market,I.Amount,I.Score From KS_ProOrderBundleSale S  left Join KS_ProductList I ON S.InfoID=I.InfoID Where S.CartID=@CartID
--Select I.Title,I.Weight,I.Price_Market,I.Amount,I.Score,B.KBPrice,b.attrid From KS_ProOrderBundleSale S Inner Join KS_ProBundleSale B ON S.InfoID=B.KBInfoID Inner Join KS_ProductList I ON S.InfoID=I.InfoID Where B.InfoID=@InfoID And S.CartID=@CartID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProGetProFromBundleSale] 
@infoId int=0,
@cartId int=0
AS
Select I.Title,I.Weight,I.Price as Price_Market,I.Amount,I.Score,B.kbprice,s.ATTRID From KS_ProBundleSelect S Inner Join KS_ProBundleSale B ON S.InfoID=B.id Inner Join KS_ProductList I ON b.kbinfoid=I.InfoID Where B.InfoID=@InfoID And S.CartID=@CartID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ProCartAddBundleSale] 
 @infoid int=0,
 @cartId int=0
AS
 DECLARE @Title nvarchar(200),@KBPrice money,@AttrId int
 
 Delete From KS_ProBundleSelect Where CartID=@CartID And InfoID=@infoid
 
 Select top 1 @Title=I.Title,@KBPrice=K.KBPrice,@AttrId=K.attrid From [KS_ProBundleSale] K inner Join [KS_ProductList] I On I.infoid=K.kbinfoid Where k.ID=@infoid

  INSERT INTO [KS_ProBundleSelect] 
      (cartID,infoId,attrid,Title,Price,Num,AddDate)
      Values(@cartID,@infoid,@AttrId,@Title,@KBPrice,1,getdate())
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKZTDel]
@pkid varchar(255)
 AS
  declare @Sql varchar(3000)
  Set @Sql='Delete From KS_PKZT Where PKID in('+@pkid+')'
  exec (@SQL)
  Set @Sql='Delete From KS_PKGD Where PKID IN('+@PKID+')'
  exec (@SQL)
  Set @Sql='Update KS_InfoList Set pkid=0 Where PKID IN('+@PKID+')'
  EXEC(@SQL)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Model](
	[ChannelID] [int] NOT NULL,
	[ModelType] [tinyint] NULL,
	[ModelName] [nvarchar](50) NOT NULL,
	[ModelTable] [nvarchar](255) NOT NULL,
	[ModelItem] [nvarchar](50) NULL,
	[ModelItemUnit] [nvarchar](50) NULL,
	[ModelStatus] [tinyint] NULL,
	[ModelFolder] [nvarchar](50) NULL,
	[ModelFsoFolder] [nvarchar](255) NULL,
	[FsoListNum] [int] NULL,
	[Intro] [nvarchar](255) NULL,
	[SeoOption] [tinyint] NULL,
	[ChargesOption] [tinyint] NULL,
	[AttributeOption] [tinyint] NULL,
	[ReceiptOption] [tinyint] NULL,
	[PKOption] [tinyint] NULL,
	[ShowOption] [varchar](255) NULL,
	[FieldsXML] [ntext] NULL,
	[BasicType] [int] NULL,
	[AdminUpFilesTF] [tinyint] NULL,
	[AdminUpFilesDir] [nvarchar](100) NULL,
	[UserUpFilesTF] [int] NULL,
	[UserUpFilesDir] [nvarchar](255) NULL,
	[AllowUpFilesSize] [int] NULL,
	[AllowUpPhotoType] [nvarchar](200) NULL,
	[AllowUpFlashType] [nvarchar](200) NULL,
	[AllowUpMediaType] [nvarchar](200) NULL,
	[AllowUpRealType] [nvarchar](200) NULL,
	[AllowUpOtherType] [nvarchar](200) NULL,
	[AllowPublication] [int] NULL,
	[RecycleBin] [tinyint] NULL,
	[PublicationVerify] [tinyint] NULL,
	[PublicationRefreshHtmlOption] [nvarchar](50) NULL,
	[PublicationModifyVerify] [tinyint] NULL,
	[CommentType] [int] NULL,
	[CommentLen] [int] NULL,
	[NewestDay] [int] NULL,
	[CommentTemplate] [nvarchar](255) NULL,
	[SearchTF] [tinyint] NULL,
	[SearchTemplate] [nvarchar](255) NULL,
	[FsoHtmlType] [int] NULL,
	[DiggByVisitor] [tinyint] NULL,
	[DiggRepeat] [tinyint] NULL,
	[DiggPerTimes] [int] NULL,
	[Setting] [text] NULL,
	[ModelOrderId] [int] NULL,
 CONSTRAINT [PK_KS_Model] PRIMARY KEY CLUSTERED 
(
	[ChannelID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Model', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型类型，系统自带或是用户自定义' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型数据表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelTable'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelItem'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目单位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelItemUnit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelStatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型英文目录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelFolder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型生成总目录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelFsoFolder'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动生成列表分页数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'FsoListNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用SEO选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'SeoOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用收费选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ChargesOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用属性选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AttributeOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用收费选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ReceiptOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用PK选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'PKOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型字段集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'FieldsXML'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型基类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @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'KS_Model', @level2type=N'COLUMN',@level2name=N'AdminUpFilesTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员上传目录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AdminUpFilesDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许会员上传标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'UserUpFilesTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'会员上传目录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'UserUpFilesDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的文件大小' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpFilesSize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的图片类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpPhotoType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的flash类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpFlashType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的Windows 媒体类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpMediaType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的Real 媒体类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpRealType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许上传的其它类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowUpOtherType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前台投稿总开关' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'AllowPublication'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前台发布是否需要审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'PublicationVerify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投稿生成选项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'PublicationRefreshHtmlOption'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核过的稿件是否允许修改' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'PublicationModifyVerify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'本模型是否允许评论' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'CommentType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'允许评论字数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'CommentLen'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最新信息设置' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'NewestDay'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'CommentTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用搜索' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'SearchTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'搜索模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'SearchTemplate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否允许游客Digg' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'DiggByVisitor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否允许重复Digg' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'DiggRepeat'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户每digg一下自动增加' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'DiggPerTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型的一些配置参数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'Setting'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Model', @level2type=N'COLUMN',@level2name=N'ModelOrderId'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Message](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SubjectID] [int] NULL,
	[ToUserName] [nvarchar](200) NULL,
	[FromUserName] [nvarchar](50) NULL,
	[MsgTitle] [nvarchar](255) NULL,
	[MsgContactMan] [nvarchar](50) NULL,
	[MsgTel] [nvarchar](50) NULL,
	[MsgMail] [nvarchar](50) NULL,
	[MsgContent] [ntext] NULL,
	[RequestInfo] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
	[Verify] [int] NULL,
	[ReadTF] [int] NULL,
	[DelTf] [tinyint] NULL,
	[PMsgID] [int] NULL,
 CONSTRAINT [PK_KS_B2B_Message] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Message', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'SubjectID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接收者用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'ToUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送者用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'FromUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'MsgTitle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'MsgContactMan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系电话' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'MsgTel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'MsgMail'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'消息内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'MsgContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'Verify'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'已读标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'ReadTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Message', @level2type=N'COLUMN',@level2name=N'DelTf'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LogSMS](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Mobile] [varchar](50) NULL,
	[AddDate] [datetime] NULL,
	[IsSuccess] [tinyint] NULL,
	[UserName] [varchar](50) NULL,
	[Remark] [text] NULL,
	[Content] [text] NULL,
	[UserIP] [varchar](50) NULL,
	[Model] [varchar](50) NULL,
	[MobileCode] [varchar](100) NULL,
 CONSTRAINT [PK_KS_LogSMS] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'Mobile'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'成功标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'IsSuccess'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发送的模型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogSMS', @level2type=N'COLUMN',@level2name=N'Model'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LogScore](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[AddDate] [datetime] NULL,
	[IP] [nvarchar](50) NULL,
	[InOrOutFlag] [tinyint] NULL,
	[Score] [int] NULL,
	[NowScore] [int] NULL,
	[AvailableScore] [int] NULL,
	[inputer] [nvarchar](50) NULL,
	[remark] [nvarchar](255) NULL,
	[ChannelID] [int] NULL,
	[infoid] [int] NULL,
	[Times] [int] NULL,
	[userId] [int] NULL,
	[PeriodID] [int] NULL,
 CONSTRAINT [PK_KS_LogScore] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'IP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'入账或扣费标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'InOrOutFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @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'KS_LogScore', @level2type=N'COLUMN',@level2name=N'NowScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可用积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'AvailableScore'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'录入员' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'inputer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'infoid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogScore', @level2type=N'COLUMN',@level2name=N'Times'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LogPoint](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [nvarchar](50) NULL,
	[UserName] [nvarchar](50) NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[AddDate] [datetime] NULL,
	[IP] [nvarchar](50) NULL,
	[InOrOutFlag] [int] NULL,
	[Point] [money] NULL,
	[NowPoint] [money] NULL,
	[Times] [int] NULL,
	[Inputer] [nvarchar](50) NULL,
	[Remark] [nvarchar](255) NULL,
	[userId] [int] NULL,
 CONSTRAINT [PK_KS_LogPoint] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'IP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'入账或扣费标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'InOrOutFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点券' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'Point'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前剩余点券' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'NowPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重复次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'Times'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'录入者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'Inputer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogPoint', @level2type=N'COLUMN',@level2name=N'Remark'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LogMoney](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NOT NULL,
	[ClientName] [nvarchar](100) NULL,
	[Money] [money] NULL,
	[CurrMoney] [money] NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[MoneyType] [int] NULL,
	[IncomeOrPayOut] [int] NULL,
	[OrderID] [nvarchar](30) NULL,
	[PaymentID] [int] NULL,
	[Remark] [nvarchar](255) NULL,
	[PayTime] [datetime] NULL,
	[Inputer] [nvarchar](50) NULL,
	[IP] [nvarchar](50) NULL,
	[Times] [int] NULL,
	[RealMoney] [money] NULL,
	[Discount] [float] NULL,
	[YjRate1] [money] NULL,
	[YjRate2] [money] NULL,
	[YjRate3] [money] NULL,
	[AgYJ1] [money] NULL,
	[AgYJ2] [money] NULL,
	[userId] [int] NULL,
 CONSTRAINT [PK_KS_LogMoney] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'客户姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'ClientName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资金' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'Money'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前余额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'CurrMoney'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'交易方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'MoneyType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'扣费或是续费标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'IncomeOrPayOut'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'订单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付平台ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'PaymentID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'PayTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'录入员' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'Inputer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'IP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重复次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'Times'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实收资金' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'RealMoney'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LogMoney', @level2type=N'COLUMN',@level2name=N'Discount'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LogDay](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[OrderID] [nvarchar](50) NULL,
	[UserName] [nvarchar](50) NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[AddDate] [datetime] NULL,
	[IP] [nvarchar](50) NULL,
	[InOrOutFlag] [int] NULL,
	[day] [int] NULL,
	[EndDay] [datetime] NULL,
	[Inputer] [nvarchar](50) NULL,
	[Remark] [nvarchar](255) NULL,
PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Log](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](max) NULL,
	[ResultTF] [tinyint] NULL,
	[ActionIP] [nvarchar](50) NULL,
	[ActionTime] [datetime] NULL,
	[ScriptName] [nvarchar](max) NULL,
	[Description] [nvarchar](max) NULL,
 CONSTRAINT [PK_KS_Log] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'成功标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'ResultTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'ActionIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'ActionTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'运行的文件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'ScriptName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Log', @level2type=N'COLUMN',@level2name=N'Description'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LinkClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [nvarchar](100) NOT NULL,
	[Description] [ntext] NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_LinkClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_LinkClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LinkClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类简介' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LinkClass', @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'KS_LinkClass', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Link](
	[LinkID] [int] IDENTITY(1,1) NOT NULL,
	[ClassID] [int] NULL,
	[SiteName] [nvarchar](255) NULL,
	[WebMaster] [nvarchar](50) NULL,
	[Email] [nvarchar](50) NULL,
	[Url] [nvarchar](255) NULL,
	[Password] [nvarchar](50) NULL,
	[LinkType] [int] NULL,
	[Logo] [nvarchar](150) NULL,
	[Description] [ntext] NULL,
	[Hits] [int] NULL,
	[Recommend] [int] NULL,
	[AddDate] [datetime] NULL,
	[Locked] [tinyint] NULL,
	[Verify] [int] NULL,
	[OrderID] [int] NULL,
 CONSTRAINT [PK_KS_Link] PRIMARY KEY CLUSTERED 
(
	[LinkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Link', @level2type=N'COLUMN',@level2name=N'LinkID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网站名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'SiteName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'站长' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'WebMaster'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'网址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理密码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Password'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'链接类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'LinkType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'LOGO图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Logo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'站点描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @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'KS_Link', @level2type=N'COLUMN',@level2name=N'Hits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'推荐标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Recommend'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'锁定标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Locked'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Link', @level2type=N'COLUMN',@level2name=N'Verify'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_LabelClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [nvarchar](50) NOT NULL,
	[ParentIDPath] [nvarchar](255) NULL,
	[Description] [nvarchar](255) NULL,
	[ParentID] [int] NULL,
	[OrderID] [tinyint] NULL,
	[ClassType] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[From3G] [tinyint] NULL,
	[TemplateID] [int] NULL,
 CONSTRAINT [PK_KS_LabelClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标签分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'ParentIDPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'ParentID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类类别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'ClassType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否手机版建的' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_LabelClass', @level2type=N'COLUMN',@level2name=N'From3G'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Label](
	[LabelID] [int] NOT NULL,
	[LabelName] [nvarchar](50) NOT NULL,
	[LabelContent] [ntext] NULL,
	[Description] [ntext] NULL,
	[ClassID] [int] NULL,
	[OrderID] [tinyint] NULL,
	[LabelType] [tinyint] NULL,
	[LabelFlag] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[From3G] [tinyint] NULL,
	[TemplateID] [int] NULL,
	[JsonID] [nvarchar](50) NULL,
 CONSTRAINT [PK_KS_Label] PRIMARY KEY NONCLUSTERED 
(
	[LabelID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否手机版建的' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Label', @level2type=N'COLUMN',@level2name=N'From3G'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_KeyTags](
	[TagsID] [int] IDENTITY(1,1) NOT NULL,
	[KeyText] [nvarchar](100) NOT NULL,
	[AddDate] [datetime] NULL,
	[TagsHits] [int] NULL,
	[TodayHits] [int] NULL,
	[YesterDayHits] [int] NULL,
	[WeekHits] [int] NULL,
	[LastUseTime] [datetime] NULL,
	[Status] [int] NULL,
	[FirstAlphabet] [varchar](50) NULL,
	[Type] [tinyint] NULL,
	[CourseNum] [int] NULL,
	[SjNum] [int] NULL,
	[UserNum] [int] NULL,
 CONSTRAINT [PK_KS_KeyTags] PRIMARY KEY CLUSTERED 
(
	[TagsID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'TagsID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Tags名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'KeyText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'TagsHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'今日使用次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'TodayHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'昨天使用次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'YesterDayHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'周使用次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'WeekHits'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后使用时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'LastUseTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_KeyTags', @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'KS_KeyTags', @level2type=N'COLUMN',@level2name=N'FirstAlphabet'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_JSFile](
	[JSID] [int] IDENTITY(1,1) NOT NULL,
	[JSName] [nvarchar](100) NULL,
	[JSFileName] [nvarchar](100) NULL,
	[JSConfig] [ntext] NULL,
	[JSType] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[Description] [nvarchar](255) NULL,
	[OrderID] [tinyint] NULL,
	[ClassID] [int] NULL,
	[From3g] [tinyint] NULL,
	[TemplateID] [int] NULL,
 CONSTRAINT [PK_KS_JSFile] PRIMARY KEY CLUSTERED 
(
	[JSID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'JS名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'JSName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'JS生成的文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'JSFileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'JS配置信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'JSConfig'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'JS类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'JSType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'添加时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @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'KS_JSFile', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否手机版建的JS' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_JSFile', @level2type=N'COLUMN',@level2name=N'From3g'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_MoodProject](
	[ProjectID] [int] IDENTITY(1,1) NOT NULL,
	[ProjectName] [varchar](100) NULL,
	[ProjectContent] [nvarchar](3000) NULL,
	[OnlyUser] [tinyint] NULL,
	[UserOnce] [int] NULL,
	[AllowGroupID] [varchar](200) NULL,
	[Status] [tinyint] NULL,
	[TimeLimit] [tinyint] NULL,
	[StartDate] [datetime] NULL,
	[ExpiredDate] [datetime] NULL,
 CONSTRAINT [PK_KS_MoodProject] PRIMARY KEY CLUSTERED 
(
	[ProjectID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'心情指数项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'ProjectID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'ProjectName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'ProjectContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'只允许会员表态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'OnlyUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每个会员只能表态一次' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'UserOnce'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组限制' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'AllowGroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @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'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'TimeLimit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'StartDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodProject', @level2type=N'COLUMN',@level2name=N'ExpiredDate'
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodListDel] 
@ids varchar(1000)
AS
 if (@ids<>'')
  begin
 declare @sql nvarchar(4000)
 set @sql='delete from KS_MoodList Where ID in('+@ids+')'
 exec (@sql)
 end
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_MoodList](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[MoodID] [int] NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[Title] [nvarchar](50) NULL,
	[M0] [int] NULL,
	[M1] [int] NULL,
	[M2] [int] NULL,
	[M3] [int] NULL,
	[M4] [int] NULL,
	[M5] [int] NULL,
	[M6] [int] NULL,
	[M7] [int] NULL,
	[M8] [int] NULL,
	[M9] [int] NULL,
	[M10] [int] NULL,
	[M11] [int] NULL,
	[M12] [int] NULL,
	[M13] [int] NULL,
	[M14] [int] NULL,
 CONSTRAINT [PK_KS_MoodList] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'心情指数ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'MoodID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项1票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M0'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项2票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M1'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项3票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M2'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项4票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M3'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项5票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M4'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项6票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M5'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项7票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M6'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项8票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M7'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项9票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M8'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项10票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M9'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项11票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M10'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项12票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M11'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项13票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M12'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项14票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M13'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项15票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_MoodList', @level2type=N'COLUMN',@level2name=N'M14'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_PKGD](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[PKID] [int] NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[Content] [ntext] NULL,
	[UserIP] [nvarchar](50) NULL,
	[Status] [tinyint] NULL,
	[AddDate] [smalldatetime] NULL,
	[Role] [int] NULL,
	[UserID] [int] NULL,
 CONSTRAINT [PK_KS_PKGD] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_PKGD', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PK项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @level2type=N'COLUMN',@level2name=N'PKID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PK内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @level2type=N'COLUMN',@level2name=N'UserIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @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'KS_PKGD', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交角色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKGD', @level2type=N'COLUMN',@level2name=N'Role'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_PhotoClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [varchar](50) NOT NULL,
	[OrderID] [int] NOT NULL,
	[IsDefault] [tinyint] NULL,
 CONSTRAINT [PK_KS_PHOTOCLASS] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PhotoClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PhotoClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PhotoClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PhotoClass', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'相册分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PhotoClass'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_PaymentPlatItem](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[PayId] [int] NULL,
	[AccountID] [varchar](150) NULL,
	[Md5Key] [varchar](255) NULL,
	[IsDefault] [int] NULL,
 CONSTRAINT [PK_KS_PaymentPlatItem] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlatItem', @level2type=N'COLUMN',@level2name=N'PayId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台账号ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlatItem', @level2type=N'COLUMN',@level2name=N'AccountID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台密钥' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlatItem', @level2type=N'COLUMN',@level2name=N'Md5Key'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlatItem', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_PaymentPlat](
	[ID] [int] NOT NULL,
	[PlatName] [nvarchar](50) NULL,
	[Remark] [ntext] NULL,
	[AccountID] [nvarchar](50) NULL,
	[MD5Key] [nvarchar](100) NULL,
	[Rate] [float] NULL,
	[RateByUser] [tinyint] NULL,
	[OrderID] [int] NULL,
	[IsDisabled] [tinyint] NOT NULL,
	[IsDefault] [tinyint] NOT NULL,
	[ApplyUrl] [varchar](255) NULL,
	[showflag] [tinyint] NULL,
	[Logo] [nvarchar](255) NULL,
	[Setting] [text] NULL,
	[ShowDevice] [varchar](200) NULL,
 CONSTRAINT [PK_KS_PaymentPlat] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'PlatName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台备注说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'平台的账号ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'AccountID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付密钥' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'MD5Key'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'费率' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'Rate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手续费由付款人额外支付' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'RateByUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'IsDisabled'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否默认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'IsDefault'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'ApplyUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前台是正式启用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PaymentPlat', @level2type=N'COLUMN',@level2name=N'showflag'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_CollectionHistory](
	[HistoryID] [int] IDENTITY(1,1) NOT NULL,
	[ItemID] [int] NULL,
	[ModelID] [int] NULL,
	[InfoID] [int] NULL,
	[ClassID] [int] NULL,
	[Title] [varchar](255) NULL,
	[ItemUrl] [varchar](255) NULL,
	[Remark] [varchar](255) NULL,
	[IsSucceed] [int] NULL,
	[RecordTime] [datetime] NULL,
 CONSTRAINT [PK_KS_CollectionHistory] PRIMARY KEY CLUSTERED 
(
	[HistoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集历史记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'HistoryID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'ItemID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'ModelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集的URL' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'ItemUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否采集成功' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'IsSucceed'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_CollectionHistory', @level2type=N'COLUMN',@level2name=N'RecordTime'
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodProjectDel]
 @projectids nvarchar(1000)
 AS
  declare @sql nvarchar(1500)
  set @sql='delete from KS_MoodProject Where projectid in('+@projectids+')'
  exec (@sql)
  set @sql='delete from KS_MoodList Where moodid in('+@projectids+')'
   exec (@sql)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGDUnVerifySelect]
@Ids nvarchar(1000)
 AS
  If @Ids=''
    return null
 Else
   Begin
  DECLARE @SQL Nvarchar(3000)
  SET @SQL='Update KS_PKGD SET Status=0  WHERE ID In('+@ids+')'
  EXEC (@SQL)
  End
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGDDelete]
@Ids nvarchar(1000)
 AS
  If @Ids=''
    return null
 Else
   Begin
  DECLARE @SQL Nvarchar(3000)
  SET @SQL='Delete From KS_PKGD WHERE ID In('+@ids+')'
  EXEC (@SQL)
  End
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGDDel]
@Ids nvarchar(1000)
 AS
  DECLARE @SQL Nvarchar(3000)
  SET @SQL='DELETE FROM KS_PKGD WHERE id in('+@Ids+')'
  EXEC (@SQL)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGDVerifySelect]
@Ids nvarchar(1000)
 AS
  If @Ids=''
    return null
 Else
   Begin
  DECLARE @SQL Nvarchar(3000)
  SET @SQL='Update KS_PKGD SET Status=1 WHERE ID In('+@ids+')'
  EXEC (@SQL)
  End
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGetGDList] 
@num int=0,
@pkid int=0,
@role int=1
as
 declare @SQL Nvarchar(3000)
 SET @SQL='select top ' +convert(nvarchar(50),@num) +'  * from [KS_PKGD] Where pkid='+convert(nvarchar(50),@pkid)+' and role='+convert(nvarchar(50),@role)+' Order by id desc'
 Exec (@SQL)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_PKZT](
	[PKID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](255) NOT NULL,
	[ZFGD] [text] NULL,
	[FFGD] [text] NULL,
	[UserTF] [tinyint] NULL,
	[OnceTF] [tinyint] NULL,
	[VerifyTF] [tinyint] NULL,
	[Status] [tinyint] NULL,
	[TimeLimit] [tinyint] NULL,
	[BeginDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[InfoID] [int] NULL,
	[ZFVotes] [int] NULL,
	[FFVotes] [int] NULL,
	[SFVotes] [int] NULL,
 CONSTRAINT [PK_KS_PKZT] PRIMARY KEY CLUSTERED 
(
	[PKID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_PKZT', @level2type=N'COLUMN',@level2name=N'PKID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PK标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'正方观点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'ZFGD'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'反方观点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'FFGD'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'只允许会员参与PK' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'UserTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每个用户只能参与PK一次' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'OnceTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户PK意见需要审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'VerifyTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @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'KS_PKZT', @level2type=N'COLUMN',@level2name=N'TimeLimit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'EndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应的文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'正方票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'ZFVotes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'反方票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'FFVotes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'第三方票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_PKZT', @level2type=N'COLUMN',@level2name=N'SFVotes'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Vote](
	[VoteID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [ntext] NOT NULL,
	[BeginDate] [datetime] NULL,
	[ExpireDate] [datetime] NULL,
	[VoteType] [tinyint] NULL,
	[LimitIP] [int] NULL,
	[UserTF] [int] NULL,
	[InfoID] [int] NULL,
	[VoteScore] [int] NULL,
 CONSTRAINT [PK_KS_Vote] PRIMARY KEY CLUSTERED 
(
	[VoteID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_Vote', @level2type=N'COLUMN',@level2name=N'VoteID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'Subject'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'ExpireDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查类型单选项是多选' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'VoteType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'启用IP限制' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'LimitIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'只允许会员投票' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'UserTF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_Vote', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_ViewRecords](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[username] [varchar](50) NULL,
	[basicType] [int] NULL,
	[channelid] [int] NULL,
	[infoid] [int] NULL,
	[adddate] [datetime] NULL,
 CONSTRAINT [PK_KS_ViewRecords] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最近浏览的记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'username'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'基类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'basicType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'channelid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'infoid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'浏览时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_ViewRecords', @level2type=N'COLUMN',@level2name=N'adddate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserVisitors](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserId] [int] NULL,
	[UserName] [varchar](255) NULL,
	[VisitorId] [int] NULL,
	[Visitor] [varchar](255) NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_BLOGVISITORS] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主人空间ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'UserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主人空间用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访客用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'VisitorId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访客用户' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'Visitor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访问时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserVisitors', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserVipCard](
	[VipCardID] [int] IDENTITY(1,1) NOT NULL,
	[Cardname] [nvarchar](250) NULL,
	[FaceValue] [money] NULL,
	[VipDays] [int] NULL,
	[SVipDays] [int] NULL,
	[AutoCreateFXS] [int] NULL,
	[BeginDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[Inputer] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[Status] [tinyint] NULL,
	[DefaultPic] [varchar](255) NULL,
	[Intro] [varchar](255) NULL,
	[MustInputRecommender] [int] NULL,
 CONSTRAINT [PK_KS_UserVipCard] PRIMARY KEY CLUSTERED 
(
	[VipCardID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserRecord](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserIP] [nvarchar](50) NULL,
	[flag] [int] NULL,
	[note] [nvarchar](255) NULL,
	[adddate] [datetime] NULL,
	[userid] [int] NULL,
	[UserName] [nvarchar](50) NULL,
	[orderid] [varchar](50) NULL,
 CONSTRAINT [PK_KS_UserRecord] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserRecord', @level2type=N'COLUMN',@level2name=N'UserIP'
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'KS_UserRecord', @level2type=N'COLUMN',@level2name=N'flag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'操作说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserRecord', @level2type=N'COLUMN',@level2name=N'note'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserRecord', @level2type=N'COLUMN',@level2name=N'userid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserRecord', @level2type=N'COLUMN',@level2name=N'UserName'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserPhotos](
	[PicID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[UserName] [varchar](255) NULL,
	[TypeID] [int] NULL,
	[ClassID] [int] NULL,
	[Title] [varchar](255) NULL,
	[Tags] [varchar](255) NULL,
	[Content] [text] NULL,
	[Source] [varchar](255) NULL,
	[Author] [varchar](255) NULL,
	[Hit] [int] NULL,
	[AddDate] [datetime] NULL,
	[PhotoUrl] [varchar](255) NULL,
	[PicUrls] [text] NULL,
	[Status] [tinyint] NULL,
	[Fund] [int] NULL,
	[PageSize] [int] NULL,
	[Hot] [tinyint] NULL,
	[TopList] [tinyint] NULL,
	[Best] [tinyint] NULL,
	[Model] [int] NULL,
 CONSTRAINT [PK_KS_USERPHOTOS] PRIMARY KEY CLUSTERED 
(
	[PicID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'PicID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户自己分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'TypeID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关键字' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Tags'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'说明内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'图片来源' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Source'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'作者' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Author'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Hit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'增加\修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'缩略图' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'PhotoUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主组图' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'PicUrls'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @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'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Fund'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每页多少张' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'PageSize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'热门标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Hot'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'置顶标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'TopList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示模式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos', @level2type=N'COLUMN',@level2name=N'Model'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户相册表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserPhotos'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserMobileLog](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](255) NULL,
	[UserID] [int] NULL,
	[UserIP] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
	[mobile] [nvarchar](255) NULL,
	[tjmobile] [nvarchar](255) NULL,
	[DeviceType] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserLoginLog](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](255) NULL,
	[UserID] [int] NULL,
	[UserIP] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
	[Remark] [nvarchar](255) NULL,
	[loginFrom] [int] NULL,
	[DeviceType] [int] NULL,
	[IsLogInAnoplace] [int] NULL,
	[LoginAddress] [nvarchar](100) NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserGroup](
	[GroupID] [int] NOT NULL,
	[GroupName] [nvarchar](100) NOT NULL,
	[PowerList] [ntext] NULL,
	[Descript] [ntext] NULL,
	[Type] [int] NULL,
	[ChargeType] [int] NULL,
	[GroupPoint] [int] NULL,
	[ValidDays] [int] NULL,
	[FormID] [int] NULL,
	[IsReg] [int] NULL,
	[SpaceSize] [float] NULL,
	[UpfilesDir] [varchar](255) NULL,
	[Settings] [ntext] NULL,
	[OrderID] [int] NULL,
	[IsGroupPrice] [int] NULL,
	[AutoUpdate] [tinyint] NULL,
	[AutoUpdateText] [int] NULL,
	[AutoUpdateScore] [int] NULL,
	[AutoUpdateCharge] [int] NULL,
	[prusername] [nvarchar](50) NULL,
 CONSTRAINT [PK_KS_UserGroup] PRIMARY KEY CLUSTERED 
(
	[GroupID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'GroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'GroupName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'PowerList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类型标志，是否系统自带的用户组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @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'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'ChargeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认赠送积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'GroupPoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'默认有效天数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'ValidDays'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'绑定的表单ID号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'FormID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用前台注册' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'IsReg'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分配的空间大小' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'SpaceSize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传的目录' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'UpfilesDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组参数配置' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'Settings'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'序号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'商城用户组单独设置价格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserGroup', @level2type=N'COLUMN',@level2name=N'IsGroupPrice'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserForm](
	[FormID] [int] IDENTITY(1,1) NOT NULL,
	[FormName] [nvarchar](200) NOT NULL,
	[FieldNameList] [ntext] NULL,
	[Template] [ntext] NULL,
	[Note] [ntext] NULL,
 CONSTRAINT [PK_KS_UserForm] PRIMARY KEY CLUSTERED 
(
	[FormID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_UserForm', @level2type=N'COLUMN',@level2name=N'FormID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'会员表单名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserForm', @level2type=N'COLUMN',@level2name=N'FormName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单项的字段集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserForm', @level2type=N'COLUMN',@level2name=N'FieldNameList'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'表单模板' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserForm', @level2type=N'COLUMN',@level2name=N'Template'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注说明' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserForm', @level2type=N'COLUMN',@level2name=N'Note'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserFeeSell](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](50) NOT NULL,
	[UserID] [int] NOT NULL,
	[PackID] [int] NOT NULL,
	[orderid] [varchar](50) NULL,
	[PackBeginDate] [datetime] NULL,
	[PackDays] [int] NULL,
	[Limit] [int] NULL,
	[ExamTF] [int] NULL,
	[ContentTF] [int] NULL,
	[CourseTF] [int] NULL,
	[ContentClassIds] [text] NULL,
	[ExamClassIds] [text] NULL,
	[CosClassIds] [text] NULL,
	[examids] [text] NULL,
	[cosids] [text] NULL,
	[AddDate] [datetime] NULL,
	[CardNum] [nvarchar](50) NULL,
	[PassWord] [nvarchar](50) NULL,
	[UseFlag] [tinyint] NULL,
	[Note] [nvarchar](1000) NULL,
	[PointNumber] [int] NOT NULL,
	[PointType] [int] NULL,
	[Inputer] [varchar](50) NULL,
	[UserInfo] [text] NULL,
	[trangTF] [int] NULL,
	[trangClassIds] [text] NULL,
	[GiveVIPDay] [int] NULL,
	[type] [tinyint] NULL,
	[analysistf] [int] NULL,
	[analysisclassids] [text] NULL,
	[expiredate] [datetime] NULL,
 CONSTRAINT [PK_KS_UserFeeSell] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'充值数值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeeSell', @level2type=N'COLUMN',@level2name=N'PointNumber'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'充值类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeeSell', @level2type=N'COLUMN',@level2name=N'PointType'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserFeePackages](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[title] [nvarchar](255) NOT NULL,
	[adddate] [datetime] NULL,
	[Descript] [ntext] NULL,
	[flag] [int] NULL,
	[days] [int] NULL,
	[price] [money] NULL,
	[status] [int] NULL,
	[limit] [int] NULL,
	[examtf] [int] NULL,
	[contenttf] [int] NULL,
	[coursetf] [int] NULL,
	[examclassids] [text] NULL,
	[contentclassids] [text] NULL,
	[cosclassids] [text] NULL,
	[examids] [text] NULL,
	[cosids] [text] NULL,
	[usetype] [int] NULL,
	[BeginDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[CardPrefix] [varchar](200) NULL,
	[PhotoUrl] [varchar](255) NULL,
	[Inputer] [nvarchar](50) NULL,
	[RangeType] [tinyint] NULL,
	[IsUp] [tinyint] NULL,
	[UpOrder] [int] NULL,
	[UpGroup] [int] NULL,
	[DownGroup] [int] NULL,
	[IsIdentity] [tinyint] NULL,
	[AgreeMent] [text] NULL,
	[CardType] [tinyint] NULL,
	[PointNumber] [int] NULL,
	[PointType] [int] NULL,
	[GroupId] [varchar](50) NULL,
	[TrangTF] [int] NULL,
	[TrangClassIds] [text] NULL,
	[GiveVIPDay] [int] NULL,
	[type] [tinyint] NULL,
	[analysistf] [int] NULL,
	[analysisclassids] [text] NULL,
	[SectionTyptID] [int] NULL,
	[SubjectlistTyptID] [int] NULL,
 CONSTRAINT [PK_KS_UserFeePackages] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'examclassids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指定课程分类id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'cosclassids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指定试卷id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'examids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指定课程id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'cosids'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'使用方式 0线下开通 1 线上购买' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'usetype'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'线下开通开始时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'线下开通截止日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'EndDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'套餐包前缀' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'CardPrefix'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否开启升级' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'IsUp'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'购买套餐升级用户组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'UpGroup'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'套餐过期降级用户组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'DownGroup'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'购买套餐是否开启身份认证' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'IsIdentity'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'套餐购买协议' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'AgreeMent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'营销卡类型 0套餐 1充值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'CardType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'PointNumber'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'资金类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeePackages', @level2type=N'COLUMN',@level2name=N'PointType'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserFeeDiscount](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[groupid] [int] NOT NULL,
	[discount] [real] NULL,
	[status] [int] NULL,
	[packid] [int] NOT NULL,
 CONSTRAINT [PK_KS_UserFeeDiscount] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录D' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeeDiscount', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeeDiscount', @level2type=N'COLUMN',@level2name=N'groupid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折扣' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserFeeDiscount', @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'KS_UserFeeDiscount', @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'KS_UserFeeDiscount', @level2type=N'COLUMN',@level2name=N'packid'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserDepartment](
	[DepartID] [int] IDENTITY(1,1) NOT NULL,
	[DepartMentName] [nvarchar](100) NULL,
	[DepartMentEname] [nvarchar](255) NULL,
	[ParentID] [int] NULL,
	[Root] [int] NULL,
	[Depth] [tinyint] NULL,
	[OrderID] [int] NULL,
	[ParentIDPath] [varchar](4000) NULL,
	[Child] [int] NULL,
	[PrevID] [int] NULL,
	[NextID] [int] NULL,
	[ClassDir] [varchar](255) NULL,
	[UserName] [nvarchar](50) NULL,
	[AddDate] [datetime] NULL,
	[Intro] [ntext] NULL,
	[PhotoUrl] [varchar](255) NULL,
	[AdminPurview] [ntext] NULL,
 CONSTRAINT [PK_KS_UserDepartment] PRIMARY KEY CLUSTERED 
(
	[DepartID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'DepartID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门中文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'DepartMentName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门英文名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'DepartMentEname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门父ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'ParentID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'级别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'Root'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'深度' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'Depth'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父ID集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'ParentIDPath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子部门数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'Child'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上一个部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'PrevID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下一个部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'NextID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门英文名称集' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'ClassDir'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创始人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部门图片' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'PhotoUrl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'权限' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserDepartment', @level2type=N'COLUMN',@level2name=N'AdminPurview'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserConfig](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[UserField] [ntext] NULL,
 CONSTRAINT [PK_KS_UserConfig] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UserBlogClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](255) NULL,
	[ClassName] [varchar](255) NULL,
	[Descript] [varchar](1000) NULL,
	[AddDate] [datetime] NULL,
	[OrderID] [int] NULL,
	[UserID] [int] NULL,
 CONSTRAINT [PK_KS_USERBLOGCLASS] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'ClassName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分类描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'Descript'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'AddDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户日志分类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UserBlogClass'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[GroupID] [int] NULL,
	[AskRankId] [int] NULL,
	[DepartId] [int] NULL,
	[UserName] [nvarchar](100) NOT NULL,
	[PassWord] [nvarchar](100) NULL,
	[Question] [nvarchar](50) NULL,
	[Answer] [nvarchar](50) NULL,
	[Email] [nvarchar](50) NULL,
	[RealName] [nvarchar](50) NULL,
	[Mobile] [nvarchar](50) NULL,
	[IsMobileRZ] [tinyint] NULL,
	[Sex] [nvarchar](50) NULL,
	[Birthday] [nvarchar](50) NULL,
	[IDCard] [nvarchar](50) NULL,
	[ProId] [int] NULL,
	[CityId] [int] NULL,
	[CountyId] [int] NULL,
	[Address] [nvarchar](200) NULL,
	[HomePage] [nvarchar](50) NULL,
	[UserFace] [varchar](255) NULL,
	[Sign] [ntext] NULL,
	[Privacy] [int] NULL,
	[CheckNum] [nvarchar](50) NULL,
	[RegDate] [datetime] NULL,
	[JoinDate] [datetime] NULL,
	[LastLoginTime] [datetime] NULL,
	[LastLoginIP] [nvarchar](50) NULL,
	[LoginTimes] [int] NULL,
	[ChargeType] [int] NULL,
	[BeginDate] [datetime] NULL,
	[EDays] [int] NULL,
	[Money] [money] NULL,
	[Score] [int] NULL,
	[ScoreHasUse] [int] NULL,
	[Point] [money] NULL,
	[Locked] [int] NULL,
	[RndPassword] [nvarchar](100) NULL,
	[companyname] [nvarchar](255) NULL,
	[zipcode] [nvarchar](255) NULL,
	[interest] [nvarchar](200) NULL,
	[intro] [ntext] NULL,
	[qqtoken] [nvarchar](50) NULL,
	[qqopenid] [nvarchar](50) NULL,
	[SinaId] [nvarchar](50) NULL,
	[SinaToken] [nvarchar](50) NULL,
	[AlipayID] [nvarchar](50) NULL,
	[IsApi] [tinyint] NULL,
	[Agent] [nvarchar](50) NULL,
	[WeiXinOpenID] [nvarchar](50) NULL,
	[UserQQ] [varchar](255) NULL,
	[UnionID] [varchar](255) NULL,
	[AppID] [varchar](255) NULL,
	[IsWeixinUnBind] [tinyint] NULL,
	[LoadType] [tinyint] NULL,
	[Enddate] [datetime] NULL,
	[PUserId] [int] NULL,
	[PPUserId] [int] NULL,
	[TotalMoney] [money] NULL,
	[OrderDevice] [int] NULL,
	[Setting] [nvarchar](255) NULL,
	[Salt] [varchar](100) NULL,
	[SchoolID] [int] NULL,
	[LoadEndGroupDate] [datetime] NULL,
	[LoadEndGroupID] [int] NULL,
	[IsBindGZ] [int] NULL,
	[IsAgent] [int] NULL,
	[IsAg] [int] NULL,
	[TagsIds] [varchar](1000) NULL,
	[pic] [nvarchar](200) NULL,
	[inputer] [varchar](250) NULL,
	[ItemId] [int] NULL,
	[childId] [int] NULL,
	[coursename] [varchar](255) NULL,
	[LastLoginDevice] [int] NULL,
	[MySchoolGroupID] [int] NULL,
	[ApiToken] [varchar](100) NULL,
	[open_space] [tinyint] NULL,
	[spacename] [varchar](50) NULL,
	[ZanCount] [int] NULL,
	[CollectCount] [int] NULL,
	[Hits] [int] NULL,
	[CustomVipType] [int] NULL,
	[space_name] [nvarchar](50) NULL,
	[worknum] [int] NULL,
	[SvipLoadType] [int] NULL,
	[SvipEnddate] [datetime] NULL,
	[PagentUserID] [int] NULL,
	[PPagentUserID] [int] NULL,
	[VipCardID] [int] NULL,
	[CardPassWord] [varchar](200) NULL,
	[classid] [int] NULL,
	[BmsOpenid] [nvarchar](50) NULL,
	[remark] [varchar](500) NULL,
 CONSTRAINT [PK_KS_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_User', @level2type=N'COLUMN',@level2name=N'UserID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属用户组ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'GroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属问答等级ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'AskRankId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属部门ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'DepartId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录密码（MD5加密）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'PassWord'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提问问题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Question'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题答案' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Answer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Email'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'真实姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'RealName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Mobile'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'手机是否经过实名认证' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'IsMobileRZ'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'性别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Sex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出生日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Birthday'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'身份证号码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'IDCard'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'省份ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'ProId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城市ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'CityId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'城镇ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'CountyId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'联系地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Address'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'个人主页' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'HomePage'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'头像' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'UserFace'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Sign'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'隐私设置' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Privacy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'激活码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'CheckNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'注册日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'RegDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'加入日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'JoinDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登录的时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'LastLoginTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'最后登录的IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'LastLoginIP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登录次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'LoginTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收费模式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'ChargeType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收费开始日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'BeginDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'有效天数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'EDays'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可用金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Money'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可用积分' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @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'KS_User', @level2type=N'COLUMN',@level2name=N'ScoreHasUse'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'可用点券' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Point'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 正常 1锁定 2待人工审核 3待邮件验证' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Locked'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'随机密码（用于防止多人同时登录）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'RndPassword'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'公司名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'companyname'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邮编' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'zipcode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'qq接口返回的token值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'qqtoken'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'qq登录接口返回的openid' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'qqopenid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'新浪微博接口返回的用户id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'SinaId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'新浪微博接口返回的用户token' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'SinaToken'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'支付宝快捷登录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'AlipayID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是不是通过第三方快速注册登录的' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'IsApi'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'推荐人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'Agent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'微信OpenID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_User', @level2type=N'COLUMN',@level2name=N'WeiXinOpenID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_UploadFiles](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[FileName] [nvarchar](255) NOT NULL,
	[DTimes] [int] NULL,
	[DSize] [int] NULL,
	[AliasName] [nvarchar](255) NULL,
	[isAffix] [tinyint] NULL,
	[UserName] [nvarchar](100) NULL,
	[ServerType] [int] NULL,
	[ServerCreate] [nvarchar](50) NULL,
	[ServerURL] [nchar](255) NULL,
 CONSTRAINT [PK_KS_UploadFiles] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模型ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'ChannelID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下载次数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'DTimes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件大小（字节）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'DSize'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'附件别名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'AliasName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否附件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'isAffix'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_UploadFiles', @level2type=N'COLUMN',@level2name=N'UserName'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_U_Product](
	[InfoID] [int] NOT NULL,
	[Title] [nvarchar](255) NULL,
	[ClassID] [int] NULL,
	[Content] [ntext] NULL,
	[spggt] [nvarchar](200) NULL,
	[ChannelID] [int] NULL,
	[KeyTags] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[TitleFontColor] [varchar](20) NULL,
	[Attribute] [nvarchar](255) NULL,
	[DefaultPic] [varchar](255) NULL,
	[TurnUrl] [varchar](255) NULL,
	[priority] [int] NULL,
	[Hits] [int] NULL,
	[HitsByDay] [int] NULL,
	[HitsByWeek] [int] NULL,
	[HitsByMonth] [int] NULL,
	[LastHitsTime] [datetime] NULL,
	[AddDate] [datetime] NULL,
	[VoteID] [int] NULL,
	[TemplateFile] [varchar](255) NULL,
	[Template3GFile] [varchar](255) NULL,
	[ShowON3G] [tinyint] NULL,
	[FileName] [varchar](255) NULL,
	[RefreshTF] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[DelTF] [tinyint] NULL,
	[Inputer] [varchar](100) NULL,
	[AttachmentCharge] [int] NULL,
	[AttachmentChargeOnce] [tinyint] NULL,
	[SocialIDs] [varchar](255) NULL,
	[ProvinceId] [int] NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
	[SEOTitle] [nvarchar](255) NULL,
	[SEOKeyWords] [nvarchar](255) NULL,
	[SEODescription] [nvarchar](255) NULL,
	[CommentNum] [int] NULL,
	[ProID] [varchar](20) NULL,
	[ProductType] [int] NULL,
	[Unit] [varchar](50) NULL,
	[BarCode] [varchar](100) NULL,
	[Weight] [float] NULL,
	[BigPhoto] [varchar](255) NULL,
	[ProducerName] [varchar](50) NULL,
	[TrademarkName] [varchar](50) NULL,
	[ServiceTerm] [int] NULL,
	[BrandID] [int] NULL,
	[Amount] [int] NULL,
	[AlarmNum] [int] NULL,
	[Price] [money] NULL,
	[Price_Member] [money] NULL,
	[GroupPrice] [tinyint] NULL,
	[TaxTF] [tinyint] NULL,
	[Tax] [float] NULL,
	[MinOrderNum] [int] NULL,
	[MaxOrderNum] [int] NULL,
	[Score] [int] NULL,
	[IsChangeBuy] [tinyint] NULL,
	[ChangeBuyNeedPrice] [money] NULL,
	[ChangeBuyPresentPrice] [money] NULL,
	[IsLimitbuy] [tinyint] NULL,
	[LimitBuyPrice] [money] NULL,
	[LimitBuyTaskID] [int] NULL,
	[LimitBuyAmount] [int] NULL,
	[AttributeCart] [varchar](50) NULL,
	[HasSold] [int] NULL,
	[CmtNum] [int] NULL,
	[AskNum] [int] NULL,
	[IsScoreChange] [tinyint] NULL,
	[ChangeScore] [int] NULL,
	[PayType] [tinyint] NULL,
	[FrontPrice] [money] NULL,
	[IsLimitTime] [tinyint] NULL,
	[LimitBeginDate] [datetime] NULL,
	[LimitEndDate] [datetime] NULL,
	[IsBookCode] [tinyint] NULL,
	[BookCodeTypeID] [int] NULL,
	[LimitCityNum] [int] NULL,
	[DownUrl] [nvarchar](255) NULL,
	[IsPromotions] [tinyint] NULL,
	[payID] [int] NULL,
	[IsGroupRate] [tinyint] NULL,
	[LimitBuyType] [int] NULL,
	[LimitBuyNum] [int] NULL,
	[Price_Cost] [money] NULL,
	[GoodNum] [int] NULL,
	[BadNum] [int] NULL,
	[FavNum] [int] NULL,
	[ShareNum] [int] NULL,
	[AllowBuyFlag] [tinyint] NULL,
	[ArrGroupID] [varchar](255) NULL,
	[EmptyStockTips] [nvarchar](255) NULL,
	[FreightFree] [tinyint] NULL,
PRIMARY KEY CLUSTERED 
(
	[InfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_U_Photo](
	[InfoID] [int] NOT NULL,
	[Title] [nvarchar](255) NOT NULL,
	[ClassID] [int] NOT NULL,
	[Content] [text] NULL,
	[ShowStyle] [int] NULL,
	[PageNum] [int] NULL,
	[Details] [ntext] NULL,
	[KeyTags] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[TitleFontColor] [nvarchar](50) NULL,
	[Attribute] [nvarchar](255) NULL,
	[DefaultPic] [nvarchar](255) NULL,
	[TurnUrl] [nvarchar](255) NULL,
	[priority] [int] NULL,
	[Hits] [int] NULL,
	[HitsByDay] [int] NULL,
	[HitsByWeek] [int] NULL,
	[HitsByMonth] [int] NULL,
	[LastHitsTime] [datetime] NULL,
	[AddDate] [datetime] NULL,
	[VoteID] [int] NULL,
	[TemplateFile] [nvarchar](255) NULL,
	[Template3GFile] [nvarchar](255) NULL,
	[ShowON3G] [tinyint] NULL,
	[FileName] [nvarchar](255) NULL,
	[RefreshTF] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[DelTF] [tinyint] NULL,
	[Inputer] [nvarchar](100) NULL,
	[AttachmentCharge] [int] NULL,
	[AttachmentChargeOnce] [tinyint] NULL,
	[SocialIDs] [nvarchar](255) NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
	[SEOTitle] [nvarchar](255) NULL,
	[SEOKeyWords] [nvarchar](255) NULL,
	[SEODescription] [nvarchar](255) NULL,
	[CommentNum] [int] NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Author] [nvarchar](255) NULL,
	[ProvinceID] [int] NULL,
	[ArrGroupID] [nvarchar](255) NULL,
	[ReadPoint] [money] NULL,
	[ChargeType] [tinyint] NULL,
	[PitchTime] [int] NULL,
	[ReadTimes] [int] NULL,
	[DividePercent] [int] NULL,
	[PKID] [int] NULL,
	[InfoPurview] [tinyint] NULL,
	[ChannelID] [int] NULL,
	[GoodNum] [int] NULL,
	[BadNum] [int] NULL,
	[FavNum] [int] NULL,
	[ShareNum] [int] NULL,
 CONSTRAINT [PK_KS_U_Photo] PRIMARY KEY CLUSTERED 
(
	[InfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题（图片名称）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'照片内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'显示方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'ShowStyle'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'每页显示张数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Photo', @level2type=N'COLUMN',@level2name=N'PageNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_U_download](
	[InfoID] [int] NOT NULL,
	[Title] [nvarchar](255) NOT NULL,
	[ClassID] [int] NOT NULL,
	[Content] [ntext] NULL,
	[Category] [nvarchar](200) NULL,
	[Language] [nvarchar](200) NULL,
	[Authorization] [nvarchar](200) NULL,
	[Platform] [nvarchar](255) NULL,
	[FileSize] [nvarchar](100) NULL,
	[Details] [ntext] NULL,
	[syxt] [nvarchar](255) NULL,
	[rjxj] [nvarchar](255) NULL,
	[rjlx] [nvarchar](255) NULL,
	[yuyan] [nvarchar](255) NULL,
	[KeyTags] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[TitleFontColor] [nvarchar](50) NULL,
	[Attribute] [nvarchar](255) NULL,
	[DefaultPic] [nvarchar](255) NULL,
	[TurnUrl] [nvarchar](255) NULL,
	[priority] [int] NULL,
	[Hits] [int] NULL,
	[HitsByDay] [int] NULL,
	[HitsByWeek] [int] NULL,
	[HitsByMonth] [int] NULL,
	[LastHitsTime] [datetime] NULL,
	[AddDate] [datetime] NULL,
	[VoteID] [int] NULL,
	[TemplateFile] [nvarchar](255) NULL,
	[Template3GFile] [nvarchar](255) NULL,
	[ShowON3G] [tinyint] NULL,
	[FileName] [nvarchar](255) NULL,
	[RefreshTF] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[DelTF] [tinyint] NULL,
	[Inputer] [nvarchar](100) NULL,
	[AttachmentCharge] [int] NULL,
	[AttachmentChargeOnce] [tinyint] NULL,
	[SocialIDs] [nvarchar](255) NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
	[SEOTitle] [nvarchar](255) NULL,
	[SEOKeyWords] [nvarchar](255) NULL,
	[SEODescription] [nvarchar](255) NULL,
	[CommentNum] [int] NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Author] [nvarchar](255) NULL,
	[ProvinceID] [int] NULL,
	[ArrGroupID] [nvarchar](255) NULL,
	[ReadPoint] [money] NULL,
	[ChargeType] [tinyint] NULL,
	[PitchTime] [int] NULL,
	[ReadTimes] [int] NULL,
	[DividePercent] [int] NULL,
	[PKID] [int] NULL,
	[InfoPurview] [tinyint] NULL,
	[ChannelID] [int] NULL,
	[GoodNum] [int] NULL,
	[BadNum] [int] NULL,
	[FavNum] [int] NULL,
	[ShareNum] [int] NULL,
	[rjdx] [nvarchar](255) NULL,
	[type] [nvarchar](200) NULL,
 CONSTRAINT [PK_KS_U_download] PRIMARY KEY CLUSTERED 
(
	[InfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_U_download', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档详细内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'类别' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Category'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'语言' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Language'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'授权' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Authorization'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'运行平台' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'Platform'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'软件大小' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_download', @level2type=N'COLUMN',@level2name=N'FileSize'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_U_Article](
	[InfoID] [int] NOT NULL,
	[Title] [nvarchar](255) NOT NULL,
	[ClassID] [int] NOT NULL,
	[Content] [ntext] NULL,
	[PageTitle] [ntext] NULL,
	[KeyTags] [nvarchar](255) NULL,
	[Intro] [nvarchar](255) NULL,
	[TitleFontColor] [nvarchar](50) NULL,
	[Attribute] [nvarchar](255) NULL,
	[DefaultPic] [nvarchar](255) NULL,
	[TurnUrl] [nvarchar](255) NULL,
	[priority] [int] NULL,
	[Rank] [nvarchar](50) NULL,
	[Hits] [int] NULL,
	[HitsByDay] [int] NULL,
	[HitsByWeek] [int] NULL,
	[HitsByMonth] [int] NULL,
	[LastHitsTime] [datetime] NULL,
	[AddDate] [datetime] NULL,
	[VoteID] [int] NULL,
	[TemplateFile] [nvarchar](255) NULL,
	[Template3GFile] [nvarchar](255) NULL,
	[ShowON3G] [tinyint] NULL,
	[FileName] [nvarchar](255) NULL,
	[RefreshTF] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[DelTF] [tinyint] NULL,
	[Inputer] [nvarchar](100) NULL,
	[AttachmentCharge] [int] NULL,
	[AttachmentChargeOnce] [tinyint] NULL,
	[SocialIDs] [varchar](255) NULL,
	[CityID] [int] NULL,
	[CountyID] [int] NULL,
	[SEOTitle] [nvarchar](255) NULL,
	[SEOKeyWords] [nvarchar](255) NULL,
	[SEODescription] [nvarchar](255) NULL,
	[CommentNum] [int] NULL,
	[CopyFrom] [nvarchar](255) NULL,
	[Author] [nvarchar](255) NULL,
	[ProvinceID] [int] NULL,
	[ArrGroupID] [nvarchar](255) NULL,
	[ReadPoint] [money] NULL,
	[ChargeType] [tinyint] NULL,
	[PitchTime] [int] NULL,
	[ReadTimes] [int] NULL,
	[DividePercent] [int] NULL,
	[PKID] [int] NULL,
	[InfoPurview] [tinyint] NULL,
	[Channelid] [int] NULL,
	[GoodNum] [int] NULL,
	[BadNum] [int] NULL,
	[FavNum] [int] NULL,
	[ShareNum] [int] NULL,
	[aaaaaaaaa] [nvarchar](255) NULL,
	[ggggg] [nvarchar](255) NULL,
	[sex] [nvarchar](255) NULL,
 CONSTRAINT [PK_KS_U_Article] PRIMARY KEY CLUSTERED 
(
	[InfoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) 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'KS_U_Article', @level2type=N'COLUMN',@level2name=N'InfoID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档标题' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Article', @level2type=N'COLUMN',@level2name=N'Title'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'栏目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Article', @level2type=N'COLUMN',@level2name=N'ClassID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档详细内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_U_Article', @level2type=N'COLUMN',@level2name=N'Content'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_TemplateClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [nvarchar](100) NULL,
	[AddDate] [datetime] NULL,
	[ClassType] [tinyint] NULL,
PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_Template](
	[TemplateId] [int] IDENTITY(1,1) NOT NULL,
	[TemplateName] [nvarchar](250) NULL,
	[Author] [varchar](250) NULL,
	[TemplateEname] [nvarchar](250) NULL,
	[IsDefault] [int] NULL,
	[DefaultPic] [nvarchar](150) NULL,
	[AddDate] [datetime] NULL,
	[TemplateType] [int] NULL,
	[GroupLevel] [varchar](255) NULL,
	[OriTemplateID] [int] NULL,
	[Intro] [ntext] NULL,
	[IsViewEdit] [tinyint] NULL,
	[AgentType] [int] NULL,
	[IsResponsive] [tinyint] NULL,
 CONSTRAINT [PK_KS_Template] PRIMARY KEY CLUSTERED 
(
	[TemplateId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_YunOpenUser](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Domain] [nvarchar](255) NULL,
	[AppID] [nvarchar](255) NULL,
	[AppKey] [nvarchar](255) NULL,
	[Status] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[AddDate] [datetime] NULL,
	[EMail] [nvarchar](255) NULL,
	[Mobile] [nvarchar](255) NULL,
	[YazTokenDate] [datetime] NULL,
	[Token] [nvarchar](200) NULL,
	[UserID] [int] NULL,
	[SchoolName] [varchar](200) NULL,
	[UserName] [varchar](100) NULL,
	[KetangjieUserName] [varchar](200) NULL,
	[KeTangJieWxID] [int] NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_YunAPP](
	[AppID] [int] IDENTITY(1,1) NOT NULL,
	[YunAppID] [int] NULL,
	[AppType] [int] NULL,
	[FileZip] [nvarchar](250) NULL,
	[BinFileList] [ntext] NULL,
	[TablePre] [varchar](100) NULL,
	[AppName] [nvarchar](100) NULL,
	[AppEName] [varchar](100) NULL,
	[ICO] [varchar](255) NULL,
	[Descript] [ntext] NULL,
	[Author] [nvarchar](50) NULL,
	[Version] [nvarchar](50) NULL,
	[Status] [tinyint] NULL,
	[IsInstall] [tinyint] NULL,
PRIMARY KEY CLUSTERED 
(
	[AppID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WorkTable](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](50) NOT NULL,
	[ItemName] [varchar](255) NOT NULL,
	[Ico] [varchar](255) NULL,
	[Url] [varchar](255) NULL,
	[Intro] [varchar](255) NULL,
	[OrderID] [int] NULL,
 CONSTRAINT [PK_KS_WorkTable] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作台记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'管理员账号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作台显示的项目名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'ItemName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作台显示的图标' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'Ico'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工作台的链接地址' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'Url'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'简要介绍' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'Intro'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WorkTable', @level2type=N'COLUMN',@level2name=N'OrderID'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WJTK](
	[TmId] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[TypeId] [int] NULL,
	[Tmtype] [int] NULL,
	[Title] [nvarchar](255) NULL,
	[Tmnr] [ntext] NULL,
	[Answer] [ntext] NULL,
	[OptionNum] [int] NULL,
	[OrderID] [int] NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_WJTK] PRIMARY KEY CLUSTERED 
(
	[TmId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WJRndZJ](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SJID] [int] NULL,
	[TmType] [int] NULL,
	[TmIds] [nvarchar](255) NULL,
	[OrderID] [int] NULL,
	[Title] [nvarchar](255) NULL,
	[FS] [real] NULL,
	[Num] [int] NULL,
	[Intro] [ntext] NULL,
 CONSTRAINT [PK_KS_WJRndZJ] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WJItem](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[title] [varchar](255) NULL,
	[intro] [varchar](4000) NULL,
	[IsIP] [tinyint] NULL,
	[IsLogin] [tinyint] NULL,
	[IsAsk] [tinyint] NULL,
	[IsList] [tinyint] NULL,
	[point] [float] NULL,
	[groupids] [varchar](100) NULL,
	[inputer] [varchar](50) NULL,
	[AddDate] [datetime] NULL,
	[EditDate] [datetime] NULL,
	[OpenTimeLimit] [tinyint] NULL,
	[TimeLimitBegin] [datetime] NULL,
	[TimeLimitEnd] [datetime] NULL,
	[dtfs] [int] NULL,
	[Tempview] [varchar](255) NULL,
	[TempOver] [varchar](255) NULL,
	[departIds] [varchar](100) NULL,
	[verify] [tinyint] NULL,
	[hits] [int] NULL,
	[answerNum] [int] NULL,
	[courseid] [int] NULL,
 CONSTRAINT [PK_KS_Wenjian] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WJanswer](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[sjid] [int] NULL,
	[typeid] [int] NULL,
	[tmid] [int] NULL,
	[tmtype] [tinyint] NULL,
	[tmanswer] [varchar](100) NULL,
	[tktanswer] [ntext] NULL,
	[username] [varchar](50) NULL,
	[AddDate] [datetime] NULL,
	[userIP] [varchar](50) NULL,
 CONSTRAINT [PK_KS_WJanswer] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinUser](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[URL] [nvarchar](255) NULL,
	[Token] [nvarchar](50) NULL,
	[OpenName] [nvarchar](50) NULL,
	[WeiXinName] [nvarchar](50) NULL,
	[WeiXinOpenID] [nvarchar](50) NULL,
	[WeiXinType] [tinyint] NULL,
	[Verify] [tinyint] NULL,
	[Appid] [nvarchar](50) NULL,
	[Secret] [nvarchar](100) NULL,
	[Access_Token] [nvarchar](512) NULL,
	[Access_YouXRQ] [datetime] NULL,
	[WeiXinStatus] [int] NULL,
	[EncodingAESKey] [varchar](100) NULL,
	[MessageEnType] [varchar](50) NULL,
	[ErCodeimg] [varchar](255) NULL,
	[Intro] [ntext] NULL,
	[TypeFlag] [tinyint] NULL,
	[UserID] [int] NULL,
	[ticket] [varchar](500) NULL,
	[tickettime] [varchar](500) NULL,
	[ticket_token] [varchar](512) NULL,
	[auth_refresh_token] [varchar](512) NULL,
	[auth_access_token] [varchar](512) NULL,
	[RefreshDate] [datetime] NULL,
 CONSTRAINT [PK_KS_WeixinUser] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinTemplateClass](
	[ClassID] [int] IDENTITY(1,1) NOT NULL,
	[ClassType] [tinyint] NULL,
	[ClassName] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_WeixinTemplateClass] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinTemplate](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[TemplateName] [nvarchar](255) NULL,
	[TemplateFolder] [nvarchar](255) NULL,
	[TemplateType] [int] NULL,
	[TemplateAuthor] [nvarchar](100) NULL,
	[TemplatePic] [nvarchar](255) NULL,
	[IsDefault] [int] NULL,
	[CopyRight] [nvarchar](255) NULL,
	[AddDate] [datetime] NULL,
 CONSTRAINT [PK_KS_WeixinTemplate] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeiXinQunFA](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[SendType] [tinyint] NULL,
	[SuCaiID] [int] NULL,
	[Content] [ntext] NULL,
	[AddPeoPle] [varchar](50) NULL,
	[AddDate] [datetime] NULL,
	[TypeFlag] [tinyint] NULL,
	[TuwenID] [varchar](100) NULL,
	[ShopID] [varchar](100) NULL,
	[MassObject] [varchar](300) NULL,
	[MassStatus] [varchar](50) NULL,
	[MassMessageID] [varchar](100) NULL,
	[WeiXinOpenID] [varchar](600) NULL,
	[UserID] [int] NULL,
	[CourseID] [nvarchar](255) NULL,
	[CosType] [tinyint] NULL,
 CONSTRAINT [PK_KS_WeiXinGroup] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinPigmsg](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](300) NULL,
	[IsPic] [tinyint] NULL,
	[ParentID] [int] NULL,
	[Info] [varchar](600) NULL,
	[PicUrl] [varchar](600) NULL,
	[Type] [tinyint] NULL,
	[Content] [ntext] NULL,
	[Url] [varchar](600) NULL,
	[AddTime] [datetime] NULL,
	[ClassID] [nvarchar](255) NULL,
	[AddPeople] [nvarchar](50) NULL,
	[Media_ID] [varchar](600) NULL,
	[TuWenID] [varchar](100) NULL,
	[ShopID] [varchar](100) NULL,
	[TypeFlag] [tinyint] NULL,
	[Show_cover_pic] [tinyint] NULL,
	[Thumb_media_id] [varchar](600) NULL,
	[SystemType] [tinyint] NULL,
	[userID] [int] NULL,
	[CourseID] [int] NULL,
	[CosType] [tinyint] NULL,
 CONSTRAINT [PK_KS_WeixinPigmsg] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_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'KS_WeixinPigmsg', @level2type=N'COLUMN',@level2name=N'TypeFlag'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否显示封面：0不显示，1显示' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WeixinPigmsg', @level2type=N'COLUMN',@level2name=N'Show_cover_pic'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'区分系统类型：1代表图文，2商品' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WeixinPigmsg', @level2type=N'COLUMN',@level2name=N'SystemType'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinOpenuser](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[WeiXinOpenID] [varchar](50) NULL,
	[Subscribe] [tinyint] NULL,
	[OpenID] [varchar](100) NULL,
	[NickName] [nvarchar](50) NULL,
	[Sex] [tinyint] NULL,
	[Language] [nvarchar](50) NULL,
	[City] [nvarchar](50) NULL,
	[Province] [nvarchar](50) NULL,
	[Country] [nvarchar](50) NULL,
	[HeadImgurl] [nvarchar](255) NULL,
	[Subscribe_Time] [datetime] NULL,
	[Verify] [tinyint] NULL,
	[GroupID] [varchar](100) NULL,
	[Remark] [ntext] NULL,
	[Flag] [tinyint] NULL,
	[UnionID] [varchar](50) NULL,
	[SchoolID] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'分组编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WeixinOpenuser', @level2type=N'COLUMN',@level2name=N'GroupID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WeixinOpenuser', @level2type=N'COLUMN',@level2name=N'Remark'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinMsg](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[FromUserName] [nvarchar](200) NULL,
	[ToUserName] [nvarchar](200) NULL,
	[CreateTime] [datetime] NULL,
	[MsgType] [nvarchar](50) NULL,
	[Content] [ntext] NULL,
	[MediaId] [nvarchar](200) NULL,
	[PicUrl] [nvarchar](200) NULL,
	[Format] [nvarchar](255) NULL,
	[ThumbMediaId] [nvarchar](50) NULL,
	[Location_X] [nvarchar](50) NULL,
	[Location_Y] [nvarchar](50) NULL,
	[Scale] [ntext] NULL,
	[Label] [nvarchar](250) NULL,
	[Title] [nvarchar](255) NULL,
	[Url] [nvarchar](255) NULL,
	[Remark] [ntext] NULL,
	[AddTime] [datetime] NULL,
	[ReplyPeople] [nvarchar](50) NULL,
	[ReplyContent] [ntext] NULL,
	[ReplyTime] [datetime] NULL,
	[ReplyType] [tinyint] NULL,
	[ReplyStatus] [tinyint] NULL,
	[TuWenID] [varchar](100) NULL,
	[ShopID] [varchar](100) NULL,
	[SuCaiID] [varchar](100) NULL,
	[IsRead] [tinyint] NULL,
	[CourseID] [varchar](100) NULL,
	[CosType] [tinyint] NULL,
 CONSTRAINT [PK_KS_WeixinMsg] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否已读：1代表已读，0代表未读' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_WeixinMsg', @level2type=N'COLUMN',@level2name=N'IsRead'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinMenu](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ClassName] [nvarchar](100) NULL,
	[ParentID] [int] NULL,
	[OrderID] [int] NULL,
	[Type] [nvarchar](50) NULL,
	[KeyWord] [nvarchar](200) NULL,
	[Url] [nvarchar](200) NULL,
	[TypeName] [nvarchar](50) NULL,
	[UserName] [varchar](50) NULL,
	[ModifyNum] [tinyint] NULL,
	[UserID] [int] NULL,
	[ClassID] [int] NULL,
	[ChannelID] [int] NULL,
	[InfoID] [int] NULL,
	[TypeFlag] [int] NULL,
	[SuCaiID] [int] NULL,
	[CourseID] [int] NULL,
	[CosType] [tinyint] NULL,
 CONSTRAINT [PK_KS_WeixinMenu] PRIMARY KEY NONCLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinKF](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[kf_account] [nvarchar](255) NULL,
	[kf_headimgurl] [nvarchar](255) NULL,
	[kf_id] [nvarchar](255) NULL,
	[kf_nick] [nvarchar](255) NULL,
	[kf_wx] [nvarchar](255) NULL
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeixinKeyWord](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[IsKeyWord] [tinyint] NULL,
	[KeyWord] [nvarchar](50) NULL,
	[Type] [tinyint] NULL,
	[Content] [ntext] NULL,
	[Picmsg] [int] NULL,
	[AddTime] [datetime] NULL,
	[Hits] [int] NULL,
	[AddPeople] [nvarchar](50) NULL,
	[UserID] [int] NULL,
	[TypeFlag] [int] NULL,
	[TypeName] [varchar](50) NULL,
	[TuWenID] [varchar](100) NULL,
	[ShopID] [varchar](100) NULL,
	[Title] [varchar](60) NULL,
	[SuCaiID] [varchar](100) NULL,
	[CourseID] [varchar](100) NULL,
	[CosType] [tinyint] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_WeiXinGroupInfo](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[GroupID] [varchar](100) NULL,
	[GroupName] [varchar](100) NULL,
	[GroupCount] [int] NULL,
	[UserID] [int] NULL,
 CONSTRAINT [PK_KS_WeiXinGroupInfo] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_VoteLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[VoteID] [int] NOT NULL,
	[UserName] [nvarchar](50) NULL,
	[IP] [nvarchar](50) NULL,
	[VoteDate] [datetime] NULL,
 CONSTRAINT [PK_KS_VoteLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteLog', @level2type=N'COLUMN',@level2name=N'LogID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteLog', @level2type=N'COLUMN',@level2name=N'VoteID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteLog', @level2type=N'COLUMN',@level2name=N'UserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户IP' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteLog', @level2type=N'COLUMN',@level2name=N'IP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'投票时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteLog', @level2type=N'COLUMN',@level2name=N'VoteDate'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [KS_VoteItem](
	[ItemID] [int] IDENTITY(1,1) NOT NULL,
	[VoteID] [int] NOT NULL,
	[ItemName] [nvarchar](255) NULL,
	[VoteNum] [int] NULL,
 CONSTRAINT [PK_KS_VoteItem] PRIMARY KEY CLUSTERED 
(
	[ItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查记录ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteItem', @level2type=N'COLUMN',@level2name=N'ItemID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'调查ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteItem', @level2type=N'COLUMN',@level2name=N'VoteID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteItem', @level2type=N'COLUMN',@level2name=N'ItemName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'选项得票数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'KS_VoteItem', @level2type=N'COLUMN',@level2name=N'VoteNum'
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_VoteAdd]
@subject nvarchar(500),
@begindate datetime=getdate,
@expiredate datetime=getdate,
@votetype int=0,
@limitip int=0,
@infoid int=0,
@usertf int=0,
@votescore int=0
 AS
Insert Into KS_vote([subject],[begindate],[expiredate],[votetype],[limitip],[infoid],[usertf],[votescore])                  
values(@subject,@begindate,@expiredate,@votetype,@limitip,@infoid,@usertf,@votescore)

 If @InfoID!=0
      Begin
       UPDATE [KS_InfoList] Set VoteID=@@identity  WHERE InfoID=@InfoID
     End
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_TagsHits] 
 @KeyText nvarchar(100)
AS

  DECLARE @TagsHits int,@TodayHits int,@YesterDayHits int,@WeekHits int,@LastUseTime datetime
  DECLARE @NowDayHits int ,@NowYesterDayHits int, @NowWeekHits int, @NowHits int

    SELECT top 1 @TagsHits=TagsHits,@TodayHits=TodayHits,@YesterDayHits=YesterDayHits,@WeekHits=WeekHits,@LastUseTime=LastUseTime FROM [KS_KeyTags] WHERE KeyText=@KeyText
  

     Set @NowHits=@TagsHits+1
     If DateDiff(week,@LastUseTime, GetDate())<=0
       SET @NowWeekHits=@WeekHits+1
     Else
      SET @NowWeekHits=1
     IF DateDiff(day,@LastUseTime,GetDate())=1
      SET @NowYesterDayHits=@YesterDayHits+1
    ELSE
     SET @NowYesterDayHits=1
    IF DateDiff(day,@LastUseTime,GetDate())<=0
     SET @NowDayHits=@TodayHits+1
   Else
     Set @NowDayHits=1

     UPDATE [KS_KeyTags] Set TagsHits=@NowDayHits,WeekHits=@NowWeekHits,YesterDayHits=@NowYesterDayHits,TodayHits=@NowDayHits,LastUseTime=GetDate()  Where KeyText=@KeyText
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGetInfo] 
@pkid int=0
AS
select top 1 * From KS_PKZT Where pkid=@pkid
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGetGDInfo]
@id int=0
 AS
SELECT TOP 1 * FROM KS_PKGD WHERE id=@id
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_PKGDVerify] 
 @Ids nvarchar(4000)
AS
  if @Ids=''
  return null
 else
  begin

    declare @sql nvarchar(4000),@gdid int,@status int
    set @sql='declare rs cursor for select id,status From KS_PKGD Where id in('+@Ids+')'
    exec (@sql)
     open rs
     fetch next from rs
     into @gdid,@status
     while @@fetch_status=0
     begin
         if @status=1
           update KS_PKGD Set Status=0 Where id=@gdid
        else
          update KS_PKGD Set Status=1 Where id=@gdid
         fetch next from rs
         into @gdid,@status
     end
     close rs
     deallocate rs
 end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_PKGDAdd]
@PKID int=0,
@UserName nvarchar(50),
@UserID int=0,
@Content ntext,
@UserIP nvarchar(50),
@Status tinyint=0,
@Adddate smalldatetime,
@Role   tinyint=0
 AS
  Insert Into [KS_PKGD](PKID,UserName,UserID,Content,UserIP,Status,AddDate,Role)
  values(@PKID,@UserName,@UserID,@Content,@UserIP,@Status,@AddDate,@Role)
  If @Role=1
   Update KS_PKZT Set ZFVotes=ZFVotes+1 Where PKID=@PKID
  Else If @Role=2
   Update KS_PKZT Set FFVotes=FFVotes+1 Where PKID=@PKID
  Else
   Update KS_PKZT Set SFVotes=SFVotes+1 Where PKID=@PKID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodProjectAdd]
@ProjectName nvarchar(255),
@Status int=0,
@ProjectContent nvarchar(4000),
@TimeLimit tinyint=0,
@StartDate SmallDateTime=getdate,
@ExpiredDate SmallDateTime=getdate,
@OnlyUser tinyint=0,
@UserOnce tinyint=0,
@AllowGroupID nvarchar(500),
 @isrepeat int=1 output
AS

 if exists(select top 1 * from KS_MoodProject Where ProjectName=@ProjectName)
   begin       
    select @isrepeat=-2 /*重名*/
    return null
   end 
else
	INSERT INTO KS_MoodProject(ProjectName,Status,ProjectContent,TimeLimit,StartDate,[ExpiredDate],OnlyUser,UserOnce,AllowGroupID) VALUES(@ProjectName,@Status,@ProjectContent,@TimeLimit,@StartDate,@ExpiredDate,@OnlyUser,@UserOnce,@AllowGroupID)
          select @isrepeat=0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_CollectionFilterInsert]
@FilterName nvarchar(255),
@FilterType int=0,
@BeginTag ntext ,
@EndTag ntext,
@ReplaceBody Ntext,
@AddDate SmallDateTime,
@Status int=0
AS
	INSERT INTO KS_CollectionFilter
                (FilterName,FilterType,BeginTag,EndTag,ReplaceBody,AddDate,Status)
              VALUES(@FilterName,@FilterType,@BeginTag,@EndTag,@ReplaceBody,@AddDate,@Status)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodProjectUpdate]
@ProjectName nvarchar(255),
@Status int=0,
@ProjectContent nvarchar(4000),
@TimeLimit tinyint=0,
@StartDate SmallDateTime=getdate,
@ExpiredDate SmallDateTime=getdate,
@OnlyUser tinyint=0,
@UserOnce tinyint=0,
@AllowGroupID nvarchar(500),
@ProjectID int=0,
 @isrepeat int=1 output

 AS
  If  exists(select top 1 *  From KS_MoodProject Where ProjectName=@ProjectName And ProjectID<>@ProjectID)
  begin
   select @isrepeat=-2 /*重名*/
   return null
  end 
 Else
  Update KS_MoodProject Set
   ProjectName=@ProjectName,
   Status=@Status,
   ProjectContent=@ProjectContent,
   TimeLimit=@TimeLimit,
   StartDate=@StartDate,
   ExpiredDate=@ExpiredDate,
   OnlyUser=@OnlyUser,
   UserOnce=@UserOnce,
   AllowGroupID=@AllowGroupID
  Where projectid=@ProjectID
 select @isrepeat=0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodProjectStatus] 
 @Projectids nvarchar(4000)
AS
  if @projectids=''
  return null
 else
  begin

    declare @sql nvarchar(4000),@projectid int,@status int
    set @sql='declare rs cursor for select projectid,status From KS_MoodProject Where projectid in('+@ProjectIDs+')'
    exec (@sql)
     open rs
     fetch next from rs
     into @projectid,@status
     while @@fetch_status=0
     begin
         if @status=1
           update KS_MoodProject Set Status=0 Where projectid=@projectid
        else
          update KS_MoodProject Set Status=1 Where projectid=@projectid
         fetch next from rs
         into @projectid,@status
     end
     close rs
     deallocate rs
 end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_MoodProjectHits] 
@MoodId int=0,
@ChannelID int,
@InfoID int,
@ItemID int,
@Title nvarchar(255)
as
declare @sql nvarchar(4000)
 if exists(select top 1 * from KS_MoodList Where moodid=@MoodID and ChannelID=@ChannelID and infoid=@infoid)
   begin
     set @sql='UPDATE KS_MoodList Set M'+convert(varchar(100),@itemid)+'=m'+convert(varchar(100),@itemid)+'+1 where moodid='+convert(varchar(100),@MoodID)+' and ChannelID='+Convert(varchar(100),@ChannelID)+' and infoid='+convert(varchar(200),@infoid)
     exec (@sql)
   end 
 else
   begin
       set @sql='insert into KS_MoodList(moodid,channelid,infoid,title,m'+convert(varchar(100),@itemid)+') values('+convert(varchar(100),@MoodID)+','+convert(varchar(100),@ChannelID)+','+convert(varchar(100),@InfoID)+','''+convert(varchar(255),@Title)+''',1)'
       exec (@sql)
   end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ModelGetMaxID] AS

 declare @modelid int
 if (exists(select top 1 channelid from ks_model))
   begin
    select @modelid=max(channelid) from ks_model
    set @modelid=@modelid+1
   end 
 else
   begin
   set @modelid=1
   end
   select @modelid
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ModelClone] 
@ModelName nvarchar(255),
@ModelTable nvarchar(255),
@ModelID int=0,
 @isrepeat int=1 output
As
  if exists(select top 1 * from ks_model where modelname=@modelname or modeltable=@modeltable)
   begin
    select @isrepeat=-2
   return null
   end
 else
   begin
  declare @MaxModelID  int
  declare @SQL nvarchar(4000)
  Select @MaxModelID=max(channelid)+1 FROM KS_Model
  Set @SQL='Insert Into [KS_Model]([channelid],[modeltype],[modelname],[modeltable],[modelitem],[modelitemunit],[modelstatus],[basictype],[modelfolder],[modelfsofolder],[fsolistnum],[intro],[chargesoption],[attributeoption],[receiptoption],[pkoption],[fieldsxml],[adminupfilestf],[adminupfilesdir],[userupfilestf],[userupfilesdir],[allowupfilessize],[allowupphototype],[allowupflashtype],[allowupmediatype],[allowuprealtype],[allowupothertype],[allowpublication],[publicationverify],[publicationrefreshhtmloption],[publicationmodifyverify],[commenttype],[commentlen],[newestday],[commenttemplate],[searchtemplate],[diggbyvisitor],[diggrepeat],[diggpertimes],[setting],[showoption],[seooption],[modelorderid]) 
    select '+convert(varchar(255),@MaxModelID)+',0,'''+convert(varchar(255),@ModelName)+''','''+convert(varchar(255),@ModelTable)+''',[modelitem],[modelitemunit],[modelstatus],[basictype],[modelfolder],[modelfsofolder],[fsolistnum],[intro],[chargesoption],[attributeoption],[receiptoption],[pkoption],[fieldsxml],[adminupfilestf],[adminupfilesdir],[userupfilestf],[userupfilesdir],[allowupfilessize],[allowupphototype],[allowupflashtype],[allowupmediatype],[allowuprealtype],[allowupothertype],[allowpublication],[publicationverify],[publicationrefreshhtmloption],[publicationmodifyverify],[commenttype],[commentlen],[newestday],[commenttemplate],[searchtemplate],[diggbyvisitor],[diggrepeat],[diggpertimes],[setting],[showoption],[seooption],modelorderid+1 from KS_Model where channelid='+convert(varchar(255),@ModelID)
   Exec (@SQL)
   Declare @Table nvarchar(4000)
   Select @Table=ModelTable From KS_Model Where channelid=@ModelID
   Set @SQL='select * into '+Convert(varchar(255),@modeltable)+' from '+@Table+' where 1=0'
   Exec (@SQL)
   Set @SQL=' alter table '+CONVERT(Nvarchar(255),@ModelTable)+' add constraint pk_'+convert(varchar(255),@MaxModelID)+'_infoid primary key(infoid)'
   Exec (@SQL)
   select @isrepeat=0
 end
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_ItemHits] 
 @Action varchar(50),
 @InfoID Int=0,
 @GetFlag int=0,
 @BasicType int=0,
 @OutHits int output
AS

  DECLARE @Hits int ,@dayhits int,@weekhits int,@monthhits int,@LastHitsTime datetime
  DECLARE @nowDayHits int ,@NowWeekHits int, @NowMonthHits int, @NowHits int
 If @BasicType=4 
    SELECT top 1 @Hits=Hits ,@DayHits=HitsByDay,@weekhits=HitsByWeek,@monthHits=HitsByMonth,@LastHitsTime=LastHitsTime FROM [KS_ProductList] WHERE InfoID=@InfoID
 Else
    SELECT top 1 @Hits=Hits ,@DayHits=HitsByDay,@weekhits=HitsByWeek,@monthHits=HitsByMonth,@LastHitsTime=LastHitsTime FROM [KS_InfoList] WHERE InfoID=@InfoID
  If @Action='count'
   BEGIN
     Set @NowHits=@Hits+1
     If DateDiff(week,@LastHitsTime, GetDate())<=0
       SET @NowWeekHits=@WeekHits+1
     Else
      SET @NowWeekHits=1
     IF DateDiff(month,@LastHitsTime,GetDate())<=0
      SET @NowMonthHits=@MonthHits+1
    ELSE
     SET @NowMonthHits=1
    IF DateDiff(day,@LastHitsTime,GetDate())<=0
     SET @NowDayHits=@DayHits+1
   Else
     Set @NowDayHits=1
   If @BasicType=4 
    UPDATE [KS_ProductList] Set Hits=@NowHits,HitsByWeek=@NowWeekHits,HitsByMonth=@NowMonthHits,HitsByDay=@NowDayHits,LastHitsTime=GetDate()  Where InfoID=@InfoID
    Else
     UPDATE [KS_InfoList] Set Hits=@NowHits,HitsByWeek=@NowWeekHits,HitsByMonth=@NowMonthHits,HitsByDay=@NowDayHits,LastHitsTime=GetDate()  Where InfoID=@InfoID

  END 
 Else
   Begin
     Set @NowHits=@Hits
     Set @NowDayHits=@DayHits
     Set @NowWeekHits=@WeekHits
     Set @NowMonthHits=@MonthHits
  END

  If @GetFlag=0 
     SELECT @OutHits= @NowHits
  Else If @GetFlag=1
     SELECT @OutHits= @NowDayHits
  Else If @GetFlag=2 
     SELECT @OutHits= @NowWeekHits
  Else If @GetFlag=3
     SELECT @OutHits=  @NowMonthHits
  Else
     SELECT @OutHits=  0
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_PKZTAddOrModify] 
 @Title nvarchar(255),
 @ZFGD nvarchar(3000),
 @FFGD nvarchar(3000),
 @ZFVotes int=0,
 @FFVotes int=0,
 @SFVotes int=0,
 @UserTF tinyint=0,
 @OnceTF tinyint=0,
 @VerifyTF tinyint=0,
 @Status tinyint=0,
 @TimeLimit tinyint=0,
 @BeginDate smalldatetime=getdate,
 @EndDate smalldatetime=getdate,
 @InfoID int=0,
 @pkid int=0
AS
    If (exists(Select top 1 pkid From KS_PKZT Where InfoID=@InfoID) and @Infoid<>0) or (exists(select top 1 pkid from ks_pkzt where pkid=@pkid) and @pkid<>0)
     Begin  
     UPDATE KS_PKZT Set  Title=@Title, ZFGD=@ZFGD, FFGD=@FFGD, UserTF=@UserTF, OnceTF=@OnceTF, VerifyTF=@VerifyTF, Status=@Status,TimeLimit=@TimeLimit, BeginDate=@BeginDate, EndDate=@EndDate,ZFVotes=@ZFVotes,FFVotes=@FFVotes,SFVotes=@SFVotes   Where pkid=@PKID
    End
   else
     Begin
    INSERT INTO KS_PKZT(
      Title,ZFGD,FFGD,UserTF,OnceTF,VerifyTF,Status,TimeLimit,BeginDate,EndDate,InfoID,ZFVotes,FFVotes,SFVotes
    )
     VALUES(
     @Title,@ZFGD,@FFGD,@UserTF,@OnceTF,@VerifyTF,@Status,@TimeLimit,@BeginDate,@EndDate,@InfoID,@ZFVotes,@FFVotes,@SFVotes
   )
     If @InfoID!=0
      Begin
       SELECT @pkid=@@identity
       UPDATE [KS_InfoList] Set PKID=@pkid WHERE InfoID=@InfoID
     End
   End
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_GetMoodProjectInfo]
 @projectid int=0
 AS
 Select top 1 * From KS_MoodProject Where projectid=@projectid
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_GetDocInputerList] AS
select inputer from KS_InfoList Group By Inputer
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_DelDigg]
@id int,
@num int=0
 AS
 Set NoCount ON
 DECLARE @DiggId int
 select top 1 @DiggId=diggid From KS_Digg Where ID=@id
 Update KS_DiggList Set SupportNum=SupportNum-@num ,AgainstNum=AgainstNum-@num  Where DiggID=@DiggID
 Delete From KS_Digg Where ID=@id
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_ContentItemAdd]
  @channelid int,
  @classid int,
  @title nvarchar(255),
  @titlefontcolor nvarchar(50),
  @intro nvarchar(255),
  @defaultpic nvarchar(255),
  @keytags nvarchar(255),
  @hits int,
  @copyfrom nvarchar(255),
  @author nvarchar(255),
  @adddate datetime,
  @attribute nvarchar(255),
  @priority nvarchar(100),
  @inputer nvarchar(100),
  @verify int,
  @refreshtf int,
  @filename nvarchar(255),
  @turnurl nvarchar(255),
  @provinceid int,
  @cityid int,
  @countyid int,
  @infopurview int,
  @arrgroupid nvarchar(255),
  @readpoint int,
  @chargetype int,
  @pitchtime int,
  @readtimes money,
  @dividepercent int,
  @attachmentcharge int,
  @attachmentchargeonce int,
  @showon3g int=0,
  @itemid int output
 AS
  INSERT INTO [KS_InfoList]

(channelid,classid,title,titlefontcolor,intro,defaultpic,keytags,hits,copyfrom,author,adddate,attribute,priority,inputer,verify,refreshtf,filename,turnurl,provinceid,cityid,countyid,infopurview,arrgroupid,readpoint,chargetype,pitchtime,readtimes,dividepercent,attachmentcharge,attachmentchargeonce,showon3g) VALUES(@channelid,@classid,@title,@titlefontcolor,@intro,@defaultpic,@keytags,@hits,@copyfrom,@author,@adddate,@attribute,@priority,@inputer,@verify,@refreshtf,@filename,@turnurl,@provinceid,@cityid,@countyid,@infopurview,@arrgroupid,@readpoint,@chargetype,@pitchtime,@readtimes,@dividepercent,@attachmentcharge,@attachmentchargeonce,@showon3g)
select @itemid=@@identity
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_CommentNum] 
 @InfoID Int=0,
 @BasicType int=0,
 @OutCommentNum int output
AS

  DECLARE @CommentNum int 
   If @BasicType=4 
    SELECT top 1 @CommentNum=CommentNum FROM [KS_ProductList] WHERE InfoID=@InfoID
 Else
    SELECT top 1 @CommentNum=CommentNum FROM [KS_InfoList] WHERE InfoID=@InfoID
    
    SELECT @OutCommentNum= @CommentNum
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_CollectionItemUpdate3]
  @FieldsRuleXml Ntext ,
  @ItemID int
 AS
  Update [KS_CollectionItem] SET  [FieldsRuleXml]=@FieldsRuleXml Where ItemID=@ItemID
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_CollectionItemUpdate2]
  @ListBeginTag ntext,
  @ListEndTag ntext,
  @LinkBeginTag ntext,
  @LinkEndTag ntext,
  @PageType int=0,
  @PageUrl varchar(255),
  @PageStartID int,
  @PageEndID int,
  @PageListUrl ntext,
  @ItemID int
 AS
  Update [KS_CollectionItem] SET 
    ListBeginTag=@ListBeginTag,
ListEndTag=@ListEndTag, 
LinkBeginTag=@LinkBeginTag,
LinkEndTag=@LinkEndTag,
PageType=@PageType,
PageUrl=@PageUrl,
PageStartID=@PageStartID,
PageEndID=@PageEndID,
PageListUrl=@PageListUrl
   WHERE ItemID=@ItemID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_CollectionItemUpdate1]
  @ItemName varchar(255),
  @ClassID int,
  @SpecialID nvarchar(255),
  @ProvinceID int=0,
  @CityID int=0,
  @CountyID int=0,
  @SiteName varchar(255),
  @CollectUrl varchar(255),
  @Encoding varchar(50),
  @Attribute varchar(50),
  @CollectOption varchar(50),
  @CollectListNum int=0,
  @CollectInfoNum int=0,
  @PausePerNum int=0,
  @PauseTime int=0,
  @Remark varchar(255),
  @ItemID int
 AS
  Update [KS_CollectionItem] SET 
      [ItemName]=@ItemName,
      [ClassID]=@ClassID,
      [SpecialID]=@SpecialID,
      [ProvinceID]=@ProvinceID,
      [CityID]=@CityID,
      [CountyID]=@CountyID,
      [SiteName]=@SiteName,
      [CollectUrl]=@CollectUrl,
      [Encoding]=@Encoding,
      [Attribute]=@Attribute,
      [CollectOption]=@CollectOption,
      [CollectListNum]=@CollectListNum,
      [CollectInfoNum]=@CollectInfoNum,
      [PausePerNum]=@PausePerNum,
      [PauseTime]=@PauseTime,
      [Remark]=@Remark
   WHERE ItemID=@ItemID
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_CollectionItemCopy]
@ItemName nvarchar(255),
@ModelID int=0,
@ClassID int ,
@SpecialID nvarchar(255),
@ProvinceID int=0,
@CityID int=0,
@CountyID int=0,
@SiteName nvarchar(255),
@CollectUrl nvarchar(255),
@Encoding nvarchar(100),
@Attribute nvarchar(100),
@CollectOption nvarchar(100),
@CollectListNum int=0,
@CollectInfoNum int=0,
@PausePerNum int=0,
@PauseTime int=0,
@Remark nvarchar(255),
@Adddate datetime,
@ListBeginTag ntext,
@ListEndTag ntext,
@LinkBeginTag ntext,
@LinkEndTag ntext,
@PageType int,
@PageUrl ntext,
@PageStartID int,
@PageEndID int,
@PageListUrl nvarchar(255),
@FieldsRuleXml ntext,
@IsCanCollect int,
@LastCollectTime datetime
AS
	INSERT INTO KS_CollectionItem([ItemName],[ModelID],[ClassID],[SpecialID],[ProvinceID],[CityID],[CountyID],[SiteName],[CollectUrl],[Encoding],[Attribute],[CollectOption],[CollectListNum],[CollectInfoNum],[PausePerNum],[PauseTime],[Remark],[AddDate],[ListBeginTag],[ListEndTag],[LinkBeginTag],[LinkEndTag],[PageType],[PageUrl],[PageStartID],[PageEndID],[PageListUrl],[FieldsRuleXml],[IsCanCollect],[LastCollectTime]) VALUES(@ItemName,@ModelID,@ClassID,@SpecialID,@ProvinceID,@CityID,@CountyID,@SiteName,@CollectUrl,@Encoding,@Attribute,@CollectOption,@CollectListNum,@CollectInfoNum,@PausePerNum,@PauseTime,@Remark,@AddDate,@ListBeginTag,@ListEndTag,@LinkBeginTag,@LinkEndTag,@PageType,@PageUrl,@PageStartID,@PageEndID,@PageListUrl,@FieldsRuleXml,@IsCanCollect,@LastCollectTime)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_CollectionItemAdd]
@itemname nvarchar(255),
@modelid int=0,
@classid int ,
@specialid nvarchar(255),
@provinceid int=0,
@cityid int=0,
@countyid int=0,
@sitename nvarchar(255),
@collecturl nvarchar(255),
@encoding nvarchar(100),
@attribute nvarchar(100),
@collectoption nvarchar(100),
@collectlistnum int=0,
@collectinfonum int=0,
@pausepernum int=0,
@pausetime int=0,
@remark nvarchar(255),
@adddate datetime,
@id int output
AS
	INSERT INTO KS_CollectionItem(ItemName,ModelID,ClassID,SpecialID,ProvinceID,CityID,CountyID,SiteName,CollectUrl,Encoding,Attribute,CollectOption,CollectListNum,CollectInfoNum,PausePerNum,PauseTime,Remark,AddDate) VALUES(@itemname,@modelid,@classid,@specialid,@provinceid,@cityid,@countyid,@sitename,@collecturl,@encoding,@attribute,@collectoption,@collectlistnum,@collectinfonum,@pausepernum,@pausetime,@remark,@adddate)
select @id=@@identity
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [KS_CollectionHistoryInsert]
  @ItemID int,
  @ModelID int,
  @ClassID int,
  @InfoID int ,
  @Title varchar(255),
  @ItemUrl varchar(255),
  @Remark varchar(255),
  @IsSucceed tinyint,
  @RecordTime datetime
 AS
   INSERT INTO [KS_CollectionHistory] 
      ([ItemID],[ModelID],[ClassID],[InfoID],[Title],[ItemUrl],[Remark],[IsSucceed],[RecordTime])
      Values(@ItemID,@ModelID,@ClassID,@InfoID,@Title,@ItemUrl,@Remark,@IsSucceed,@RecordTime)
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [KS_AdminModifyPass] 
@userName nvarchar(255),
@oldPassWord nvarchar(255),
@newPassWord nvarchar(255),
@result int out
AS
if exists(select top 1 * from KS_Admin Where [userName]=@userName and [passWord]=@oldPassWord)
   begin       
    update KS_Admin Set [passWord]=@newPassWord Where [userName]=@userName
    select @result=1
   end
else
   begin
   select @result=2
   end
GO
ALTER TABLE [KS_Adboard] ADD  DEFAULT ((0)) FOR [AdRate]
GO
ALTER TABLE [KS_Adboard] ADD  DEFAULT ((0)) FOR [Maxads]
GO
ALTER TABLE [KS_Adboard] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_Adboard] ADD  CONSTRAINT [DF_KS_Adboard_ClassID]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_ADClass] ADD  CONSTRAINT [DF_KS_ADClass_OrderId]  DEFAULT ((0)) FOR [OrderId]
GO
ALTER TABLE [KS_Adiplist] ADD  CONSTRAINT [DF_KS_Adiplist_adid]  DEFAULT ((0)) FOR [adid]
GO
ALTER TABLE [KS_Adiplist] ADD  CONSTRAINT [DF_KS_Adiplist_boardid]  DEFAULT ((0)) FOR [boardid]
GO
ALTER TABLE [KS_Adiplist] ADD  CONSTRAINT [DF_KS_Adiplist_adddate]  DEFAULT (getdate()) FOR [adddate]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF_KS_Admin_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF_KS_Admin_LastLoginTime]  DEFAULT (getdate()) FOR [LastLoginTime]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF_KS_Admin_LastLogoutTime]  DEFAULT (getdate()) FOR [LastLogoutTime]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF__KS_Admin__LoginT__7B905C75]  DEFAULT ((0)) FOR [LoginTimes]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF__KS_Admin__Locked__7C8480AE]  DEFAULT ((0)) FOR [Locked]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF_KS_Admin_SysAdmin]  DEFAULT ((0)) FOR [SysAdmin]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF__KS_Admin__UserTy__7D78A4E7]  DEFAULT ('0') FOR [UserType]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF_KS_Admin_DocPower]  DEFAULT ((0)) FOR [DocPower]
GO
ALTER TABLE [KS_Admin] ADD  CONSTRAINT [DF__KS_Admin__Role__26873E20]  DEFAULT ((0)) FOR [Role]
GO
ALTER TABLE [KS_Admin] ADD  DEFAULT ((0)) FOR [ProvinceId]
GO
ALTER TABLE [KS_Admin] ADD  DEFAULT ((0)) FOR [CityId]
GO
ALTER TABLE [KS_Admin] ADD  DEFAULT ((0)) FOR [CountyId]
GO
ALTER TABLE [KS_Admin] ADD  DEFAULT ((0)) FOR [PassWordEffectiveDays]
GO
ALTER TABLE [KS_AdminPlan] ADD  DEFAULT ((0)) FOR [IsPub]
GO
ALTER TABLE [KS_AdminRole] ADD  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__board__7F60ED59]  DEFAULT ((0)) FOR [boardid]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__AdTyp__00551192]  DEFAULT ((0)) FOR [AdType]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__ShowT__014935CB]  DEFAULT ((0)) FOR [ShowType]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__LinkT__023D5A04]  DEFAULT ((0)) FOR [LinkTarget]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__Width__03317E3D]  DEFAULT ((0)) FOR [Width]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__Heigh__0425A276]  DEFAULT ((0)) FOR [Height]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__Click__0519C6AF]  DEFAULT ((0)) FOR [Clicks]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__Views__060DEAE8]  DEFAULT ((0)) FOR [Views]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__TimeL__07020F21]  DEFAULT ((0)) FOR [TimeLimit]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF__KS_Advert__Statu__07F6335A]  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF_KS_Advertise_RecordClicks]  DEFAULT ((0)) FOR [RecordClickIP]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF_KS_Advertise_ClickAddScorePerTime]  DEFAULT ((0)) FOR [ClickAddScorePerTime]
GO
ALTER TABLE [KS_Advertise] ADD  CONSTRAINT [DF_KS_Advertise_ClickScore]  DEFAULT ((0)) FOR [ClickScore]
GO
ALTER TABLE [KS_Announce] ADD  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_Announce] ADD  CONSTRAINT [DF_KS_Announce_CityID]  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_Announce] ADD  CONSTRAINT [DF_KS_Announce_CountyId]  DEFAULT ((0)) FOR [CountyId]
GO
ALTER TABLE [KS_Area] ADD  CONSTRAINT [DF_KS_Area_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_Area] ADD  CONSTRAINT [DF_KS_Area_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_Area] ADD  CONSTRAINT [DF_KS_Area_Depth]  DEFAULT ((0)) FOR [Depth]
GO
ALTER TABLE [KS_Area] ADD  CONSTRAINT [DF_KS_Area_IsShow]  DEFAULT ((0)) FOR [IsShow]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_Root]  DEFAULT ((0)) FOR [Root]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_Depth]  DEFAULT ((0)) FOR [Depth]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_Child]  DEFAULT ((0)) FOR [Child]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_PrevID]  DEFAULT ((0)) FOR [PrevID]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_NextID]  DEFAULT ((0)) FOR [NextID]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_AskClass] ADD  CONSTRAINT [DF_KS_AskClass_ShowInTop]  DEFAULT ((0)) FOR [ShowInTop]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_TopicID]  DEFAULT ((0)) FOR [TopicID]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_addDate]  DEFAULT (getdate()) FOR [addDate]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_IsBest]  DEFAULT ((0)) FOR [IsBest]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_Status]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_UserId]  DEFAULT ((0)) FOR [UserId]
GO
ALTER TABLE [KS_AskPost] ADD  CONSTRAINT [DF_KS_AskPost_IsZj]  DEFAULT ((0)) FOR [IsZj]
GO
ALTER TABLE [KS_AskRank] ADD  CONSTRAINT [DF_KS_AskRank_IsSys]  DEFAULT ((0)) FOR [IsSys]
GO
ALTER TABLE [KS_AskRank] ADD  CONSTRAINT [DF_KS_AskGrade_Score]  DEFAULT ((0)) FOR [Score]
GO
ALTER TABLE [KS_AskRank] ADD  CONSTRAINT [DF_KS_AskGrade_QNum]  DEFAULT ((0)) FOR [QueNum]
GO
ALTER TABLE [KS_AskRank] ADD  CONSTRAINT [DF_KS_AskGrade_AnsNum]  DEFAULT ((0)) FOR [AnsNum]
GO
ALTER TABLE [KS_AskTable] ADD  CONSTRAINT [DF_KS_AskTable_IsSys]  DEFAULT ((0)) FOR [IsSys]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_classid]  DEFAULT ((0)) FOR [classid]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_UserId]  DEFAULT ((0)) FOR [UserId]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_Status]  DEFAULT ((0)) FOR [verify]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_IsSolve]  DEFAULT ((0)) FOR [IsSolve]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_IsTop]  DEFAULT ((0)) FOR [IsTop]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_Reward]  DEFAULT ((0)) FOR [Reward]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_Hits]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_PostNum]  DEFAULT ((0)) FOR [PostNum]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_Recommend]  DEFAULT ((0)) FOR [Recommend]
GO
ALTER TABLE [KS_AskTopic] ADD  CONSTRAINT [DF_KS_AskTopic_AskUserID]  DEFAULT ((0)) FOR [AskUserID]
GO
ALTER TABLE [KS_AskTopic] ADD  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_AskTopic] ADD  DEFAULT ((0)) FOR [periodid]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_userid]  DEFAULT ((0)) FOR [userid]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_ProvinceId]  DEFAULT ((0)) FOR [ProvinceId]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_CityId]  DEFAULT ((0)) FOR [CityId]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_CountyId]  DEFAULT ((0)) FOR [CountyId]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_TypeID]  DEFAULT ((0)) FOR [TypeID]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_Status]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_Recommend]  DEFAULT ((0)) FOR [Recommend]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_AskDoneNum]  DEFAULT ((0)) FOR [AskNum]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_BestNum]  DEFAULT ((0)) FOR [BestNum]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_BigClassID]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_AskZJ] ADD  CONSTRAINT [DF_KS_AskZJ_istop]  DEFAULT ((0)) FOR [istop]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Root]  DEFAULT ((0)) FOR [Root]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Child]  DEFAULT ((0)) FOR [Child]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_PrevID]  DEFAULT ((0)) FOR [PrevID]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_NextID]  DEFAULT ((0)) FOR [NextID]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_TopicNum]  DEFAULT ((0)) FOR [TopicNum]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_PostNum]  DEFAULT ((0)) FOR [PostNum]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_TodayNum]  DEFAULT ((0)) FOR [TodayNum]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Userid]  DEFAULT ((0)) FOR [Userid]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Classstatus]  DEFAULT ((0)) FOR [Classstatus]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_ClassRoomId]  DEFAULT ((0)) FOR [ClassRoomId]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Studentnum]  DEFAULT ((0)) FOR [Studentnum]
GO
ALTER TABLE [KS_BBSBoard] ADD  CONSTRAINT [DF_KS_BBSBoard_Hits]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [price]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [isrelated_buy]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [vip_ischarge]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [vip_price]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [vip_discount]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [is_allowscan]
GO
ALTER TABLE [KS_BBSBoard] ADD  DEFAULT ((0)) FOR [browse_row]
GO
ALTER TABLE [KS_BBSPost] ADD  CONSTRAINT [DF_KS_BBSPost_Verify]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_BBSPost] ADD  CONSTRAINT [DF_KS_BBSPost_UserId]  DEFAULT ((0)) FOR [UserId]
GO
ALTER TABLE [KS_BBSPost] ADD  CONSTRAINT [DF_KS_BBSPost_UserName]  DEFAULT ((0)) FOR [UserName]
GO
ALTER TABLE [KS_BBSRank] ADD  CONSTRAINT [DF_KS_BBSRank_IsSys]  DEFAULT ((0)) FOR [IsSys]
GO
ALTER TABLE [KS_BBSRank] ADD  CONSTRAINT [DF_KS_BBSRank_Score]  DEFAULT ((0)) FOR [Score]
GO
ALTER TABLE [KS_BBSRank] ADD  CONSTRAINT [DF_KS_BBSRank_QueNum]  DEFAULT ((0)) FOR [TopicNum]
GO
ALTER TABLE [KS_BBSRank] ADD  CONSTRAINT [DF_KS_BBSRank_AnsNum]  DEFAULT ((0)) FOR [PostNum]
GO
ALTER TABLE [KS_BBSTable] ADD  CONSTRAINT [DF_KS_BBSTable_IsDefault]  DEFAULT ((0)) FOR [IsDefault]
GO
ALTER TABLE [KS_BBSTable] ADD  CONSTRAINT [DF_KS_BBSTable_IsSys]  DEFAULT ((0)) FOR [IsSys]
GO
ALTER TABLE [KS_BBStest] ADD  DEFAULT ((0)) FOR [TopicId]
GO
ALTER TABLE [KS_BBStest] ADD  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_BBStest] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_BBStest] ADD  DEFAULT ((0)) FOR [UserId]
GO
ALTER TABLE [KS_BBSTopic] ADD  CONSTRAINT [DF_KS_BBSTopic_boardId]  DEFAULT ((0)) FOR [boardId]
GO
ALTER TABLE [KS_BBSTopic] ADD  CONSTRAINT [DF_KS_BBSTopic_UserId]  DEFAULT ((0)) FOR [UserId]
GO
ALTER TABLE [KS_Blog] ADD  CONSTRAINT [DF__KS_Blog__ClassID__34E9A0B9]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_Blog] ADD  CONSTRAINT [DF__KS_Blog__Templat__35DDC4F2]  DEFAULT ((0)) FOR [TemplateID]
GO
ALTER TABLE [KS_Blog] ADD  CONSTRAINT [DF__KS_Blog__Hits__36D1E92B]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_BlogInfo] ADD  DEFAULT ((0)) FOR [Hit]
GO
ALTER TABLE [KS_BlogNav] ADD  CONSTRAINT [DF__KS_BlogNa__OwnSy__5EDFDA85]  DEFAULT ((0)) FOR [OwnSys]
GO
ALTER TABLE [KS_BlogTemplate] ADD  CONSTRAINT [DF_KS_BlogTemplate_Sharetag]  DEFAULT ((0)) FOR [Sharetag]
GO
ALTER TABLE [KS_BlogTemplate] ADD  CONSTRAINT [DF_KS_BlogTemplate_UserTag]  DEFAULT ((0)) FOR [UserTag]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT (getdate()) FOR [time]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT (getdate()) FOR [adddate]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((0)) FOR [userid]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((0)) FOR [schoolid]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((1)) FOR [type]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((0)) FOR [status]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT (getdate()) FOR [approverdate]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((0)) FOR [tcid]
GO
ALTER TABLE [KS_Certificate] ADD  DEFAULT ((0)) FOR [epid]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Parent__3E52440B]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Root__3F466844]  DEFAULT ((0)) FOR [Root]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__OrderI__403A8C7D]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Child__412EB0B6]  DEFAULT ((0)) FOR [Child]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__PrevID__4222D4EF]  DEFAULT ((0)) FOR [PrevID]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__NextID__4316F928]  DEFAULT ((0)) FOR [NextID]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__ClassT__440B1D61]  DEFAULT ((1)) FOR [ClassType]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__ShowIn__44FF419A]  DEFAULT ((0)) FOR [ShowInTop]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_ShowOn3G]  DEFAULT ((0)) FOR [ShowOn3G]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__ShowIn__45F365D3]  DEFAULT ((0)) FOR [ShowInCir]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__AllowP__46E78A0C]  DEFAULT ((0)) FOR [AllowPubInfo]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_PubFlag]  DEFAULT ((1)) FOR [PubFlag]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__AllowP__47DBAE45]  DEFAULT ('0') FOR [AllowPubGroupID]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__PubAdd__48CFD27E]  DEFAULT ((0)) FOR [PubAddMoney]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__PubAdd__49C3F6B7]  DEFAULT ((0)) FOR [PubAddPoint]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__PubAdd__4AB81AF0]  DEFAULT ((0)) FOR [PubAddScore]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_CmtAddScore]  DEFAULT ((0)) FOR [CmtAddScore]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_ShareAddScore]  DEFAULT ((0)) FOR [ShareAddScore]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Create__4BAC3F29]  DEFAULT ((0)) FOR [CreateHtmlFlag]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__AutoCr__4CA06362]  DEFAULT ((0)) FOR [AutoCreateType]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_ClassFsoDirRule]  DEFAULT ((0)) FOR [ClassFsoDirRule]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_DomainBindType]  DEFAULT ((0)) FOR [DomainBindType]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__ClassP__4D94879B]  DEFAULT ((0)) FOR [ClassPurview]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Defaul__4E88ABD4]  DEFAULT ((0)) FOR [DefaultReadPoint]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Defaul__4F7CD00D]  DEFAULT ((0)) FOR [DefaultChargeType]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Defaul__5070F446]  DEFAULT ((24)) FOR [DefaultPitchTime]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Defaul__5165187F]  DEFAULT ((10)) FOR [DefaultReadTimes]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF__KS_Class__Defaul__52593CB8]  DEFAULT ((0)) FOR [DefaultDividePercent]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_InfoNum]  DEFAULT ((0)) FOR [InfoNum]
GO
ALTER TABLE [KS_Class] ADD  CONSTRAINT [DF_KS_Class_ProSpecialID]  DEFAULT ((0)) FOR [ProSpecialID]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_ModelID]  DEFAULT ((0)) FOR [ModelID]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_PageType]  DEFAULT ((0)) FOR [PageType]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_PageStartID]  DEFAULT ((0)) FOR [PageStartID]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_PageEndID]  DEFAULT ((0)) FOR [PageEndID]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_IsCanCollect]  DEFAULT ((0)) FOR [IsCanCollect]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_LastCollectTime]  DEFAULT (getdate()) FOR [LastCollectTime]
GO
ALTER TABLE [KS_CollectionItem] ADD  CONSTRAINT [DF_KS_CollectionItem_IsCreateHtml]  DEFAULT ((0)) FOR [IsCreateHtml]
GO
ALTER TABLE [KS_CollectionItem] ADD  DEFAULT ((0)) FOR [ProvinceID]
GO
ALTER TABLE [KS_CollectionItem] ADD  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_CollectionItem] ADD  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Chann__5441852A]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF_KS_Comment_ClassID]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__InfoI__5535A963]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Suppo__5629CD9C]  DEFAULT ((0)) FOR [Support]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Oppos__571DF1D5]  DEFAULT ((0)) FOR [Opposition]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Verif__5812160E]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Anony__59063A47]  DEFAULT ((0)) FOR [Anonymous]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF__KS_Commen__Viewp__59FA5E80]  DEFAULT ((0)) FOR [Viewpoint]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF_KS_Comment_Reports]  DEFAULT ((0)) FOR [Reports]
GO
ALTER TABLE [KS_Comment] ADD  CONSTRAINT [DF_KS_Comment_UserID]  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_FieldModeType]  DEFAULT ((0)) FOR [FieldModeType]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_FieldType]  DEFAULT ((1)) FOR [FieldType]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_InputItem]  DEFAULT ((0)) FOR [InputItem]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_IsDisabled]  DEFAULT ((1)) FOR [IsDisabled]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_FieldWidth]  DEFAULT ((0)) FOR [FieldWidth]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_Orderid]  DEFAULT ((0)) FOR [Orderid]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_FieldHeight]  DEFAULT ((0)) FOR [FieldHeight]
GO
ALTER TABLE [KS_CosField] ADD  CONSTRAINT [DF_KS_CosField_MaxFileSize]  DEFAULT ((0)) FOR [MaxFileSize]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [CourseID]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [IsSignIn]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [costype]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [paystatus]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [status]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [ticketid]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((0)) FOR [studentnum]
GO
ALTER TABLE [KS_CourseFaceSign] ADD  DEFAULT ((1)) FOR [isfull_sign]
GO
ALTER TABLE [KS_Digg] ADD  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_Digg] ADD  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_Digg] ADD  DEFAULT ((0)) FOR [DiggID]
GO
ALTER TABLE [KS_Digg] ADD  DEFAULT ((0)) FOR [DiggType]
GO
ALTER TABLE [KS_DiggList] ADD  CONSTRAINT [DF__KS_DiggLi__Chann__66603565]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_DiggList] ADD  CONSTRAINT [DF__KS_DiggLi__InfoI__6754599E]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_DiggList] ADD  CONSTRAINT [DF__KS_DiggLi__Suppo__68487DD7]  DEFAULT ((0)) FOR [SupportNum]
GO
ALTER TABLE [KS_DiggList] ADD  CONSTRAINT [DF__KS_DiggLi__Again__693CA210]  DEFAULT ((0)) FOR [AgainstNum]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__DownI__6C190EBB]  DEFAULT ((0)) FOR [DownID]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__Chann__6D0D32F4]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__rooti__6E01572D]  DEFAULT ((0)) FOR [rootid]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__order__6EF57B66]  DEFAULT ((0)) FOR [orders]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__paren__6FE99F9F]  DEFAULT ((0)) FOR [parentid]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__child__70DDC3D8]  DEFAULT ((0)) FOR [child]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__IsLoc__71D1E811]  DEFAULT ((0)) FOR [IsLock]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__IsOut__72C60C4A]  DEFAULT ((0)) FOR [IsOuter]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__AllDo__73BA3083]  DEFAULT ((0)) FOR [AllDownHits]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__DayDo__74AE54BC]  DEFAULT ((0)) FOR [DayDownHits]
GO
ALTER TABLE [KS_DownServer] ADD  CONSTRAINT [DF__KS_DownSe__HitsT__75A278F5]  DEFAULT (getdate()) FOR [HitsTime]
GO
ALTER TABLE [KS_Favorite] ADD  CONSTRAINT [DF__KS_Favori__Chann__787EE5A0]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_Favorite] ADD  CONSTRAINT [DF__KS_Favori__InfoI__797309D9]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_Favorite] ADD  DEFAULT ((0)) FOR [classid]
GO
ALTER TABLE [KS_FieldGroup] ADD  CONSTRAINT [DF_KS_FieldGroup_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_FieldGroup] ADD  CONSTRAINT [DF_KS_FieldGroup_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_FieldGroup] ADD  CONSTRAINT [DF_KS_FieldGroup_IsSys]  DEFAULT ((0)) FOR [IsSys]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__TimeLim__7C4F7684]  DEFAULT ((0)) FOR [TimeLimit]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__BeginDa__7D439ABD]  DEFAULT (getdate()) FOR [BeginDate]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__ExpireD__7E37BEF6]  DEFAULT (getdate()) FOR [ExpireDate]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__LimitIP__7F2BE32F]  DEFAULT ((0)) FOR [LimitIP]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__UserTF__00200768]  DEFAULT ((0)) FOR [UserTF]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF_KS_Form_UploadUserTF]  DEFAULT ((0)) FOR [UploadUserTF]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__UserOnc__01142BA1]  DEFAULT ((0)) FOR [UserOnce]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__VerifyT__02084FDA]  DEFAULT ((0)) FOR [VerifyTF]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__CodeTyp__02FC7413]  DEFAULT ((0)) FOR [CodeType]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__Status__03F0984C]  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF__KS_Form__MaxItem__04E4BC85]  DEFAULT ((0)) FOR [MaxItemID]
GO
ALTER TABLE [KS_Form] ADD  CONSTRAINT [DF_KS_Form_IsSendMail]  DEFAULT ((0)) FOR [IsSendMail]
GO
ALTER TABLE [KS_Form] ADD  DEFAULT ((0)) FOR [isReply]
GO
ALTER TABLE [KS_Form] ADD  DEFAULT ((0)) FOR [isPay]
GO
ALTER TABLE [KS_Form] ADD  DEFAULT ((0)) FOR [PayMoney]
GO
ALTER TABLE [KS_Form] ADD  DEFAULT ((0)) FOR [ShowOnUser]
GO
ALTER TABLE [KS_GuestBook] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_GuestBook] ADD  DEFAULT ((0)) FOR [IsReply]
GO
ALTER TABLE [KS_GuestBook] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__Chann__0B91BA14]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_HitsByDay]  DEFAULT ((0)) FOR [HitsByDay]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_HitsByWeek]  DEFAULT ((0)) FOR [HitsByWeek]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_HitsByMonth]  DEFAULT ((0)) FOR [HitsByMonth]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_LastHitsTime]  DEFAULT (getdate()) FOR [LastHitsTime]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_RefreshTF]  DEFAULT ((0)) FOR [RefreshTF]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_ShowOn3G]  DEFAULT ((0)) FOR [ShowOn3G]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_ProID]  DEFAULT ((0)) FOR [ProvinceID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_CityID]  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_CountyID]  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_Verify]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__InfoP__0D7A0286]  DEFAULT ((0)) FOR [InfoPurview]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__ArrGr__0E6E26BF]  DEFAULT ('0') FOR [ArrGroupID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__ReadP__0F624AF8]  DEFAULT ((0)) FOR [ReadPoint]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__Charg__10566F31]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__Pitch__114A936A]  DEFAULT ((24)) FOR [PitchTime]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__ReadT__123EB7A3]  DEFAULT ((10)) FOR [ReadTimes]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF__KS_InfoCh__Divid__1332DBDC]  DEFAULT ((0)) FOR [DividePercent]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_PKID]  DEFAULT ((0)) FOR [PKID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_VoteID]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_CMTNum]  DEFAULT ((0)) FOR [CommentNum]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_DelTF]  DEFAULT ((0)) FOR [DelTF]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_AttachmentCharge]  DEFAULT ((0)) FOR [AttachmentCharge]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_AttachmentChargeOnce]  DEFAULT ((0)) FOR [AttachmentChargeOnce]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_SocialIDs]  DEFAULT ((0)) FOR [SocialIDs]
GO
ALTER TABLE [KS_InfoList] ADD  CONSTRAINT [DF_KS_InfoList_IsTips]  DEFAULT ((0)) FOR [IsTips]
GO
ALTER TABLE [KS_InfoList] ADD  DEFAULT ((0)) FOR [GoodNum]
GO
ALTER TABLE [KS_InfoList] ADD  DEFAULT ((0)) FOR [BadNum]
GO
ALTER TABLE [KS_InfoList] ADD  DEFAULT ((0)) FOR [FavNum]
GO
ALTER TABLE [KS_InfoList] ADD  DEFAULT ((0)) FOR [ShareNum]
GO
ALTER TABLE [KS_InnerLink] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_InnerLink] ADD  CONSTRAINT [DF_KS_InnerLink_Num]  DEFAULT ((0)) FOR [Times]
GO
ALTER TABLE [KS_JSFile] ADD  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_JSFile] ADD  DEFAULT ((0)) FOR [TemplateID]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__TagsH__1AD3FDA4]  DEFAULT ((0)) FOR [TagsHits]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__Today__1BC821DD]  DEFAULT ((0)) FOR [TodayHits]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__Yeste__1CBC4616]  DEFAULT ((0)) FOR [YesterDayHits]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__WeekH__1DB06A4F]  DEFAULT ((0)) FOR [WeekHits]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__LastU__1EA48E88]  DEFAULT (getdate()) FOR [LastUseTime]
GO
ALTER TABLE [KS_KeyTags] ADD  CONSTRAINT [DF__KS_KeyTag__Statu__1F98B2C1]  DEFAULT ((1)) FOR [Status]
GO
ALTER TABLE [KS_KeyTags] ADD  DEFAULT ((0)) FOR [Type]
GO
ALTER TABLE [KS_KeyTags] ADD  DEFAULT ((0)) FOR [CourseNum]
GO
ALTER TABLE [KS_KeyTags] ADD  DEFAULT ((0)) FOR [SjNum]
GO
ALTER TABLE [KS_KeyTags] ADD  DEFAULT ((0)) FOR [UserNum]
GO
ALTER TABLE [KS_Label] ADD  CONSTRAINT [DF_KS_Label_ClassID]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_Label] ADD  DEFAULT ((0)) FOR [TemplateID]
GO
ALTER TABLE [KS_LabelClass] ADD  CONSTRAINT [DF__KS_LabelC__Paren__236943A5]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_LabelClass] ADD  CONSTRAINT [DF_KS_LabelClass_From3G]  DEFAULT ((0)) FOR [From3G]
GO
ALTER TABLE [KS_LabelClass] ADD  DEFAULT ((0)) FOR [TemplateID]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [LinkType]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [Recommend]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [Locked]
GO
ALTER TABLE [KS_Link] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_Link] ADD  CONSTRAINT [DF_KS_Link_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_Log] ADD  CONSTRAINT [DF__KS_Log__ResultTF__2EDAF651]  DEFAULT ((0)) FOR [ResultTF]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_InfoID]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_MoneyType]  DEFAULT ((0)) FOR [MoneyType]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_PaymentID]  DEFAULT ((0)) FOR [PaymentID]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_PayTime]  DEFAULT (getdate()) FOR [PayTime]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_Times]  DEFAULT ((0)) FOR [Times]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_RealMoney]  DEFAULT ((0)) FOR [RealMoney]
GO
ALTER TABLE [KS_LogMoney] ADD  CONSTRAINT [DF_KS_LogMoney_Discount]  DEFAULT ((0)) FOR [Discount]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [YjRate1]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [YjRate2]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [YjRate3]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [AgYJ1]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [AgYJ2]
GO
ALTER TABLE [KS_LogMoney] ADD  DEFAULT ((0)) FOR [userId]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF_KS_LogPoint_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF__KS_LogPoi__Chann__37703C52]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF__KS_LogPoi__InfoI__3864608B]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF__KS_LogPoi__InOrO__395884C4]  DEFAULT ((0)) FOR [InOrOutFlag]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF__KS_LogPoi__Point__3A4CA8FD]  DEFAULT ((0)) FOR [Point]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF_KS_LogPoint_NowPoint]  DEFAULT ((0)) FOR [NowPoint]
GO
ALTER TABLE [KS_LogPoint] ADD  CONSTRAINT [DF__KS_LogPoi__Times__3B40CD36]  DEFAULT ((0)) FOR [Times]
GO
ALTER TABLE [KS_LogPoint] ADD  DEFAULT ((0)) FOR [userId]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_Score]  DEFAULT ((0)) FOR [Score]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_NowScore]  DEFAULT ((0)) FOR [NowScore]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_AvailableScore]  DEFAULT ((0)) FOR [AvailableScore]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_infoid]  DEFAULT ((0)) FOR [infoid]
GO
ALTER TABLE [KS_LogScore] ADD  CONSTRAINT [DF_KS_LogScore_Times]  DEFAULT ((0)) FOR [Times]
GO
ALTER TABLE [KS_LogScore] ADD  DEFAULT ((0)) FOR [userId]
GO
ALTER TABLE [KS_LogScore] ADD  DEFAULT ((0)) FOR [PeriodID]
GO
ALTER TABLE [KS_Message] ADD  DEFAULT ((0)) FOR [SubjectID]
GO
ALTER TABLE [KS_Message] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_Message] ADD  DEFAULT ((0)) FOR [ReadTF]
GO
ALTER TABLE [KS_Message] ADD  DEFAULT ((0)) FOR [DelTf]
GO
ALTER TABLE [KS_Message] ADD  DEFAULT ((0)) FOR [PMsgID]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__ModelS__43D61337]  DEFAULT ((0)) FOR [ModelStatus]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__FsoLis__44CA3770]  DEFAULT ((2)) FOR [FsoListNum]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF_KS_Model_SeoOption]  DEFAULT ((0)) FOR [SeoOption]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Charge__45BE5BA9]  DEFAULT ((0)) FOR [ChargesOption]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Attrib__46B27FE2]  DEFAULT ((0)) FOR [AttributeOption]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Receip__47A6A41B]  DEFAULT ((0)) FOR [ReceiptOption]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF_KS_Model_PKOption]  DEFAULT ((0)) FOR [PKOption]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__BasicT__489AC854]  DEFAULT ((0)) FOR [BasicType]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__AdminU__498EEC8D]  DEFAULT ((1)) FOR [AdminUpFilesTF]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__UserUp__4A8310C6]  DEFAULT ((0)) FOR [UserUpFilesTF]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__AllowU__4B7734FF]  DEFAULT ((0)) FOR [AllowUpFilesSize]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__AllowP__4C6B5938]  DEFAULT ((0)) FOR [AllowPublication]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF_KS_Model_RecycleBin]  DEFAULT ((0)) FOR [RecycleBin]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Public__4D5F7D71]  DEFAULT ((0)) FOR [PublicationVerify]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF_KS_Model_PublicationModifyVerify]  DEFAULT ((0)) FOR [PublicationModifyVerify]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Commen__4E53A1AA]  DEFAULT ((0)) FOR [CommentType]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Commen__4F47C5E3]  DEFAULT ((0)) FOR [CommentLen]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__Newest__503BEA1C]  DEFAULT ((0)) FOR [NewestDay]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__FsoHtm__51300E55]  DEFAULT ((1)) FOR [FsoHtmlType]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__DiggBy__5224328E]  DEFAULT ((0)) FOR [DiggByVisitor]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__DiggRe__531856C7]  DEFAULT ((0)) FOR [DiggRepeat]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF__KS_Model__DiggPe__540C7B00]  DEFAULT ((0)) FOR [DiggPerTimes]
GO
ALTER TABLE [KS_Model] ADD  CONSTRAINT [DF_KS_Model_OrderId]  DEFAULT ((0)) FOR [ModelOrderId]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_MoodID]  DEFAULT ((0)) FOR [MoodID]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_InfoID]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M0]  DEFAULT ((0)) FOR [M0]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M1]  DEFAULT ((0)) FOR [M1]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M2]  DEFAULT ((0)) FOR [M2]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M3]  DEFAULT ((0)) FOR [M3]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M4]  DEFAULT ((0)) FOR [M4]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M5]  DEFAULT ((0)) FOR [M5]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M6]  DEFAULT ((0)) FOR [M6]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M7]  DEFAULT ((0)) FOR [M7]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M8]  DEFAULT ((0)) FOR [M8]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M9]  DEFAULT ((0)) FOR [M9]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M10]  DEFAULT ((0)) FOR [M10]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M11]  DEFAULT ((0)) FOR [M11]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M12]  DEFAULT ((0)) FOR [M12]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M13]  DEFAULT ((0)) FOR [M13]
GO
ALTER TABLE [KS_MoodList] ADD  CONSTRAINT [DF_KS_MoodList_M14]  DEFAULT ((0)) FOR [M14]
GO
ALTER TABLE [KS_MoodProject] ADD  CONSTRAINT [DF_KS_MoodProject_UserOnce]  DEFAULT ((0)) FOR [UserOnce]
GO
ALTER TABLE [KS_MoodProject] ADD  CONSTRAINT [DF_KS_MoodProject_Status]  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_MoodProject] ADD  CONSTRAINT [DF_KS_MoodProject_TimeLimit]  DEFAULT ((0)) FOR [TimeLimit]
GO
ALTER TABLE [KS_PaymentPlat] ADD  CONSTRAINT [DF_KS_PaymentPlat_showflag]  DEFAULT ((0)) FOR [showflag]
GO
ALTER TABLE [KS_PaymentPlatItem] ADD  CONSTRAINT [DF_KS_PaymentPlatItem_PayId]  DEFAULT ((0)) FOR [PayId]
GO
ALTER TABLE [KS_PaymentPlatItem] ADD  CONSTRAINT [DF_KS_PaymentPlatItem_IsDefault]  DEFAULT ((0)) FOR [IsDefault]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_UserTF]  DEFAULT ((0)) FOR [UserTF]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_OnceTF]  DEFAULT ((0)) FOR [OnceTF]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_VerifyTF]  DEFAULT ((0)) FOR [VerifyTF]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_Status]  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_TimeLimit]  DEFAULT ((0)) FOR [TimeLimit]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_BeginDate]  DEFAULT (getdate()) FOR [BeginDate]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_EndDate]  DEFAULT (getdate()) FOR [EndDate]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_ZFVotes]  DEFAULT ((0)) FOR [ZFVotes]
GO
ALTER TABLE [KS_PKZT] ADD  CONSTRAINT [DF_KS_PKZT_FFVotes]  DEFAULT ((0)) FOR [FFVotes]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_ProID]  DEFAULT ((0)) FOR [ProID]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_ClassId]  DEFAULT ((0)) FOR [ClassId]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_UserID]  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_StarNum]  DEFAULT ((0)) FOR [StarNum]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_CmtType]  DEFAULT ((0)) FOR [CmtType]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_Support]  DEFAULT ((0)) FOR [Support]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_CmtNum]  DEFAULT ((0)) FOR [CmtNum]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_BuyDate]  DEFAULT (getdate()) FOR [BuyDate]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_Status]  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF__KS_ProCom__order__70BE939E]  DEFAULT ((0)) FOR [orderType]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_IsReply]  DEFAULT ((0)) FOR [IsReply]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_channelid]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_schoolid]  DEFAULT ((0)) FOR [schoolid]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_infoUserId]  DEFAULT ((0)) FOR [infoUserId]
GO
ALTER TABLE [KS_ProComment] ADD  CONSTRAINT [DF_KS_ProComment_flag]  DEFAULT ((0)) FOR [flag]
GO
ALTER TABLE [KS_ProComment] ADD  DEFAULT ((0)) FOR [recommend]
GO
ALTER TABLE [KS_ProCommentReply] ADD  CONSTRAINT [DF_KS_ProCommentReply_cmtid]  DEFAULT ((0)) FOR [cmtid]
GO
ALTER TABLE [KS_ProCommentReply] ADD  CONSTRAINT [DF_KS_ProCommentReply_userid]  DEFAULT ((0)) FOR [userid]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_status]  DEFAULT ((0)) FOR [status]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_paymoney]  DEFAULT ((0)) FOR [paymoney]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_realmoney]  DEFAULT ((0)) FOR [realmoney]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_platID]  DEFAULT ((0)) FOR [platID]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_OrderType]  DEFAULT ((0)) FOR [OrderType]
GO
ALTER TABLE [KS_RechargeRecords] ADD  CONSTRAINT [DF_KS_RechargeRecords_PackID]  DEFAULT ((0)) FOR [PackID]
GO
ALTER TABLE [KS_RechargeRecords] ADD  DEFAULT ((0)) FOR [SchoolID]
GO
ALTER TABLE [KS_RechargeRecords] ADD  DEFAULT ((0)) FOR [PUserID]
GO
ALTER TABLE [KS_RegisterLog] ADD  DEFAULT ((0)) FOR [usertype]
GO
ALTER TABLE [KS_SignIn] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_SignIn] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_SignIn] ADD  DEFAULT ((0)) FOR [Num]
GO
ALTER TABLE [KS_SignIn] ADD  DEFAULT ((0)) FOR [NumType]
GO
ALTER TABLE [KS_SignIn] ADD  DEFAULT ((0)) FOR [Islianxu]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [Root]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [Depth]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [Child]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [PrevID]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [NextID]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [ShowInTop]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [IsHide]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [AskId]
GO
ALTER TABLE [KS_SiteCategory] ADD  DEFAULT ((0)) FOR [ISTemplate]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_ClassID]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_Recommend]  DEFAULT ((0)) FOR [Recommend]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_SpecialPurView]  DEFAULT ((0)) FOR [SpecialPurView]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_ReadPoint]  DEFAULT ((0)) FOR [ReadPoint]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_ChargeType]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_PitchTime]  DEFAULT ((0)) FOR [PitchTime]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_ReadTimes]  DEFAULT ((0)) FOR [ReadTimes]
GO
ALTER TABLE [KS_Special] ADD  CONSTRAINT [DF_KS_Special_Hits]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_SpecialClass] ADD  CONSTRAINT [DF_KS_SpecialClass_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_SpecialClass] ADD  CONSTRAINT [DF_KS_SpecialClass_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_SpecialR] ADD  CONSTRAINT [DF_KS_SpecialR_SpecialID]  DEFAULT ((0)) FOR [SpecialID]
GO
ALTER TABLE [KS_SpecialR] ADD  CONSTRAINT [DF_KS_SpecialR_InfoID]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_SpecialR] ADD  CONSTRAINT [DF_KS_SpecialR_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_Template] ADD  DEFAULT ((0)) FOR [TemplateType]
GO
ALTER TABLE [KS_Template] ADD  DEFAULT ((0)) FOR [OriTemplateID]
GO
ALTER TABLE [KS_Template] ADD  DEFAULT ((0)) FOR [IsViewEdit]
GO
ALTER TABLE [KS_Template] ADD  DEFAULT ((0)) FOR [AgentType]
GO
ALTER TABLE [KS_Template] ADD  DEFAULT ((0)) FOR [IsResponsive]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__InfoI__7CE47361]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Class__7DD8979A]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__prior__230AE7A0]  DEFAULT ((0)) FOR [priority]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Artic__Hits__23FF0BD9]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__HitsB__24F33012]  DEFAULT ((0)) FOR [HitsByDay]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__HitsB__25E7544B]  DEFAULT ((0)) FOR [HitsByWeek]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__HitsB__26DB7884]  DEFAULT ((0)) FOR [HitsByMonth]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__VoteI__27CF9CBD]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__ShowO__28C3C0F6]  DEFAULT ((0)) FOR [ShowON3G]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Refre__29B7E52F]  DEFAULT ((0)) FOR [RefreshTF]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Verif__2AAC0968]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__DelTF__2BA02DA1]  DEFAULT ((0)) FOR [DelTF]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Attac__2C9451DA]  DEFAULT ((0)) FOR [AttachmentCharge]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Attac__2D887613]  DEFAULT ((0)) FOR [AttachmentChargeOnce]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__CityI__2E7C9A4C]  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Count__2F70BE85]  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Comme__3064E2BE]  DEFAULT ((0)) FOR [CommentNum]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__ProID__315906F7]  DEFAULT ((0)) FOR [ProvinceID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__ReadP__324D2B30]  DEFAULT ((0)) FOR [ReadPoint]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Charg__33414F69]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Pitch__343573A2]  DEFAULT ((0)) FOR [PitchTime]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__ReadT__352997DB]  DEFAULT ((0)) FOR [ReadTimes]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__Divid__361DBC14]  DEFAULT ((0)) FOR [DividePercent]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Artic__PKID__3711E04D]  DEFAULT ((0)) FOR [PKID]
GO
ALTER TABLE [KS_U_Article] ADD  CONSTRAINT [DF__KS_U_Arti__InfoP__7C7B2A64]  DEFAULT ((0)) FOR [InfoPurview]
GO
ALTER TABLE [KS_U_Article] ADD  DEFAULT ((0)) FOR [GoodNum]
GO
ALTER TABLE [KS_U_Article] ADD  DEFAULT ((0)) FOR [BadNum]
GO
ALTER TABLE [KS_U_Article] ADD  DEFAULT ((0)) FOR [FavNum]
GO
ALTER TABLE [KS_U_Article] ADD  DEFAULT ((0)) FOR [ShareNum]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__InfoI__066DDD9B]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Class__076201D4]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__prior__4D01216C]  DEFAULT ((0)) FOR [priority]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_downl__Hits__4DF545A5]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__HitsB__4EE969DE]  DEFAULT ((0)) FOR [HitsByDay]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__HitsB__4FDD8E17]  DEFAULT ((0)) FOR [HitsByWeek]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__HitsB__50D1B250]  DEFAULT ((0)) FOR [HitsByMonth]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__VoteI__51C5D689]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__ShowO__52B9FAC2]  DEFAULT ((0)) FOR [ShowON3G]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Refre__53AE1EFB]  DEFAULT ((0)) FOR [RefreshTF]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Verif__54A24334]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__DelTF__5596676D]  DEFAULT ((0)) FOR [DelTF]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Attac__568A8BA6]  DEFAULT ((0)) FOR [AttachmentCharge]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Attac__577EAFDF]  DEFAULT ((0)) FOR [AttachmentChargeOnce]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__CityI__5872D418]  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Count__5966F851]  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Comme__5A5B1C8A]  DEFAULT ((0)) FOR [CommentNum]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__ProID__5B4F40C3]  DEFAULT ((0)) FOR [ProvinceID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__ReadP__5C4364FC]  DEFAULT ((0)) FOR [ReadPoint]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Charg__5D378935]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Pitch__5E2BAD6E]  DEFAULT ((0)) FOR [PitchTime]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__ReadT__5F1FD1A7]  DEFAULT ((0)) FOR [ReadTimes]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__Divid__6013F5E0]  DEFAULT ((0)) FOR [DividePercent]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_downl__PKID__61081A19]  DEFAULT ((0)) FOR [PKID]
GO
ALTER TABLE [KS_U_download] ADD  CONSTRAINT [DF__KS_U_down__InfoP__7E6372D6]  DEFAULT ((0)) FOR [InfoPurview]
GO
ALTER TABLE [KS_U_download] ADD  DEFAULT ((0)) FOR [GoodNum]
GO
ALTER TABLE [KS_U_download] ADD  DEFAULT ((0)) FOR [BadNum]
GO
ALTER TABLE [KS_U_download] ADD  DEFAULT ((0)) FOR [FavNum]
GO
ALTER TABLE [KS_U_download] ADD  DEFAULT ((0)) FOR [ShareNum]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__InfoI__00B50445]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Class__01A9287E]  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__ShowS__029D4CB7]  DEFAULT ((0)) FOR [ShowStyle]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__PageN__039170F0]  DEFAULT ((10)) FOR [PageNum]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__prior__38060486]  DEFAULT ((0)) FOR [priority]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Photo__Hits__38FA28BF]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__HitsB__39EE4CF8]  DEFAULT ((0)) FOR [HitsByDay]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__HitsB__3AE27131]  DEFAULT ((0)) FOR [HitsByWeek]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__HitsB__3BD6956A]  DEFAULT ((0)) FOR [HitsByMonth]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__VoteI__3CCAB9A3]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__ShowO__3DBEDDDC]  DEFAULT ((0)) FOR [ShowON3G]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Refre__3EB30215]  DEFAULT ((0)) FOR [RefreshTF]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Verif__3FA7264E]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__DelTF__409B4A87]  DEFAULT ((0)) FOR [DelTF]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Attac__418F6EC0]  DEFAULT ((0)) FOR [AttachmentCharge]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Attac__428392F9]  DEFAULT ((0)) FOR [AttachmentChargeOnce]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__CityI__4377B732]  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Count__446BDB6B]  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Comme__455FFFA4]  DEFAULT ((0)) FOR [CommentNum]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__ProID__465423DD]  DEFAULT ((0)) FOR [ProvinceID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__ReadP__47484816]  DEFAULT ((0)) FOR [ReadPoint]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Charg__483C6C4F]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Pitch__49309088]  DEFAULT ((0)) FOR [PitchTime]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__ReadT__4A24B4C1]  DEFAULT ((0)) FOR [ReadTimes]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__Divid__4B18D8FA]  DEFAULT ((0)) FOR [DividePercent]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Photo__PKID__4C0CFD33]  DEFAULT ((0)) FOR [PKID]
GO
ALTER TABLE [KS_U_Photo] ADD  CONSTRAINT [DF__KS_U_Phot__InfoP__7D6F4E9D]  DEFAULT ((0)) FOR [InfoPurview]
GO
ALTER TABLE [KS_U_Photo] ADD  DEFAULT ((0)) FOR [GoodNum]
GO
ALTER TABLE [KS_U_Photo] ADD  DEFAULT ((0)) FOR [BadNum]
GO
ALTER TABLE [KS_U_Photo] ADD  DEFAULT ((0)) FOR [FavNum]
GO
ALTER TABLE [KS_U_Photo] ADD  DEFAULT ((0)) FOR [ShareNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [priority]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [HitsByDay]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [HitsByWeek]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [HitsByMonth]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ShowON3G]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [RefreshTF]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [DelTF]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [AttachmentCharge]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [AttachmentChargeOnce]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ProvinceId]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [CityID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [CountyID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [CommentNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ProductType]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Weight]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ServiceTerm]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [BrandID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Amount]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [AlarmNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Price]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Price_Member]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [GroupPrice]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [TaxTF]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Tax]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [MinOrderNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [MaxOrderNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Score]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsChangeBuy]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ChangeBuyNeedPrice]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ChangeBuyPresentPrice]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsLimitbuy]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitBuyPrice]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitBuyTaskID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitBuyAmount]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [HasSold]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [CmtNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [AskNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsScoreChange]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ChangeScore]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [PayType]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [FrontPrice]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsLimitTime]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsBookCode]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [BookCodeTypeID]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitCityNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsPromotions]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [IsGroupRate]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitBuyType]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [LimitBuyNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [Price_Cost]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [GoodNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [BadNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [FavNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [ShareNum]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [AllowBuyFlag]
GO
ALTER TABLE [KS_U_Product] ADD  DEFAULT ((0)) FOR [FreightFree]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_ChannelID]  DEFAULT ((0)) FOR [ChannelID]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_InfoID]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_DTimes]  DEFAULT ((0)) FOR [DTimes]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_DSize]  DEFAULT ((0)) FOR [DSize]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_isAffix]  DEFAULT ((0)) FOR [isAffix]
GO
ALTER TABLE [KS_UploadFiles] ADD  CONSTRAINT [DF_KS_UploadFiles_ServerType]  DEFAULT ((0)) FOR [ServerType]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__GroupID__7D0E9093]  DEFAULT ((0)) FOR [GroupID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_AskRankId]  DEFAULT ((0)) FOR [AskRankId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_DepartId]  DEFAULT ((0)) FOR [DepartId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_IsMobileRZ]  DEFAULT ((0)) FOR [IsMobileRZ]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_ProId]  DEFAULT ((0)) FOR [ProId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_CityId]  DEFAULT ((0)) FOR [CityId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_CountyId]  DEFAULT ((0)) FOR [CountyId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Privacy__7FEAFD3E]  DEFAULT ((0)) FOR [Privacy]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_RegDate]  DEFAULT (getdate()) FOR [RegDate]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_JoinDate]  DEFAULT (getdate()) FOR [JoinDate]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_LastLoginTime]  DEFAULT (getdate()) FOR [LastLoginTime]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__LoginTi__00DF2177]  DEFAULT ((0)) FOR [LoginTimes]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__ChargeT__01D345B0]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_BeginDate]  DEFAULT (getdate()) FOR [BeginDate]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__EDays__03BB8E22]  DEFAULT ((0)) FOR [EDays]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_Money]  DEFAULT ((0)) FOR [Money]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Score__04AFB25B]  DEFAULT ((0)) FOR [Score]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_ScoreHasUse]  DEFAULT ((0)) FOR [ScoreHasUse]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Point__05A3D694]  DEFAULT ((0)) FOR [Point]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Locked__0697FACD]  DEFAULT ((0)) FOR [Locked]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_IsApi]  DEFAULT ((0)) FOR [IsApi]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__IsWeixi__249EF5AE]  DEFAULT ((0)) FOR [IsWeixinUnBind]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__LoadTyp__259319E7]  DEFAULT ((0)) FOR [LoadType]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__PUserId__629C2827]  DEFAULT ((0)) FOR [PUserId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__PPUserI__63904C60]  DEFAULT ((0)) FOR [PPUserId]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__TotalMo__04BC3601]  DEFAULT ((0)) FOR [TotalMoney]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__OrderDe__05B05A3A]  DEFAULT ((0)) FOR [OrderDevice]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_SchoolID]  DEFAULT ((0)) FOR [SchoolID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF_KS_User_LoadEndGroupID]  DEFAULT ((0)) FOR [LoadEndGroupID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__IsBindG__230BB2F7]  DEFAULT ((0)) FOR [IsBindGZ]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__IsAgent__23FFD730]  DEFAULT ((0)) FOR [IsAgent]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__IsAg__3065AE15]  DEFAULT ((0)) FOR [IsAg]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__LastLog__7C1CCE5F]  DEFAULT ((0)) FOR [LastLoginDevice]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__MySchoo__18B90D0D]  DEFAULT ((0)) FOR [MySchoolGroupID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__open_sp__19AD3146]  DEFAULT ((0)) FOR [open_space]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__ZanCoun__1AA1557F]  DEFAULT ((0)) FOR [ZanCount]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Collect__1B9579B8]  DEFAULT ((0)) FOR [CollectCount]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__Hits__1C899DF1]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__CustomV__336D0349]  DEFAULT ((0)) FOR [CustomVipType]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__worknum__64103AA4]  DEFAULT ((0)) FOR [worknum]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__SvipLoa__65045EDD]  DEFAULT ((0)) FOR [SvipLoadType]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__SvipEnd__65F88316]  DEFAULT (getdate()) FOR [SvipEnddate]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__PagentU__66ECA74F]  DEFAULT ((0)) FOR [PagentUserID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__PPagent__67E0CB88]  DEFAULT ((0)) FOR [PPagentUserID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__VipCard__68D4EFC1]  DEFAULT ((0)) FOR [VipCardID]
GO
ALTER TABLE [KS_User] ADD  CONSTRAINT [DF__KS_User__classid__69C913FA]  DEFAULT ((0)) FOR [classid]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_Root]  DEFAULT ((0)) FOR [Root]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_Depth]  DEFAULT ((0)) FOR [Depth]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_Child]  DEFAULT ((0)) FOR [Child]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_PrevID]  DEFAULT ((0)) FOR [PrevID]
GO
ALTER TABLE [KS_UserDepartment] ADD  CONSTRAINT [DF_KS_UserDepartment_NextID]  DEFAULT ((0)) FOR [NextID]
GO
ALTER TABLE [KS_UserFeeDiscount] ADD  CONSTRAINT [DF_KS_UserFeeDiscount_discount]  DEFAULT ((0)) FOR [discount]
GO
ALTER TABLE [KS_UserFeeDiscount] ADD  CONSTRAINT [DF_KS_UserFeeDiscount_status]  DEFAULT ((0)) FOR [status]
GO
ALTER TABLE [KS_UserFeeDiscount] ADD  CONSTRAINT [DF_KS_UserFeeDiscount_packid]  DEFAULT ((0)) FOR [packid]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_flag]  DEFAULT ((0)) FOR [flag]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_days]  DEFAULT ((0)) FOR [days]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_price]  DEFAULT ((0)) FOR [price]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_status]  DEFAULT ((0)) FOR [status]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_modelid]  DEFAULT ((0)) FOR [limit]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_coursetf]  DEFAULT ((0)) FOR [coursetf]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_usetype]  DEFAULT ((1)) FOR [usetype]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_RangeType]  DEFAULT ((0)) FOR [RangeType]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_IsUp]  DEFAULT ((0)) FOR [IsUp]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_UpGroup]  DEFAULT ((0)) FOR [UpGroup]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_DownGroup]  DEFAULT ((0)) FOR [DownGroup]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_IsIdentity]  DEFAULT ((0)) FOR [IsIdentity]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_CardType]  DEFAULT ((0)) FOR [CardType]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_PointNumber]  DEFAULT ((0)) FOR [PointNumber]
GO
ALTER TABLE [KS_UserFeePackages] ADD  CONSTRAINT [DF_KS_UserFeePackages_PointType]  DEFAULT ((0)) FOR [PointType]
GO
ALTER TABLE [KS_UserFeePackages] ADD  DEFAULT ((0)) FOR [TrangTF]
GO
ALTER TABLE [KS_UserFeePackages] ADD  DEFAULT ((0)) FOR [GiveVIPDay]
GO
ALTER TABLE [KS_UserFeePackages] ADD  DEFAULT ((0)) FOR [type]
GO
ALTER TABLE [KS_UserFeePackages] ADD  DEFAULT ((0)) FOR [analysistf]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_PackDays]  DEFAULT ((0)) FOR [PackDays]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_CourseTF]  DEFAULT ((0)) FOR [CourseTF]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_UseFlag]  DEFAULT ((0)) FOR [UseFlag]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_PointNumber]  DEFAULT ((0)) FOR [PointNumber]
GO
ALTER TABLE [KS_UserFeeSell] ADD  CONSTRAINT [DF_KS_UserFeeSell_PointType]  DEFAULT ((0)) FOR [PointType]
GO
ALTER TABLE [KS_UserFeeSell] ADD  DEFAULT ((0)) FOR [trangTF]
GO
ALTER TABLE [KS_UserFeeSell] ADD  DEFAULT ((0)) FOR [GiveVIPDay]
GO
ALTER TABLE [KS_UserFeeSell] ADD  DEFAULT ((0)) FOR [type]
GO
ALTER TABLE [KS_UserFeeSell] ADD  DEFAULT ((0)) FOR [analysistf]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__Group__1209AD79]  DEFAULT ((0)) FOR [GroupID]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGro__Type__12FDD1B2]  DEFAULT ((0)) FOR [Type]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__Charg__13F1F5EB]  DEFAULT ((0)) FOR [ChargeType]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__Group__14E61A24]  DEFAULT ((0)) FOR [GroupPoint]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__Valid__15DA3E5D]  DEFAULT ((0)) FOR [ValidDays]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__FormI__16CE6296]  DEFAULT ((0)) FOR [FormID]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF__KS_UserGr__IsReg__17C286CF]  DEFAULT ((0)) FOR [IsReg]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF_KS_UserGroup_SpaceSize]  DEFAULT ((0)) FOR [SpaceSize]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF_KS_UserGroup_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_UserGroup] ADD  CONSTRAINT [DF_KS_UserGroup_IsGroupPrice]  DEFAULT ((0)) FOR [IsGroupPrice]
GO
ALTER TABLE [KS_UserGroup] ADD  DEFAULT ((0)) FOR [AutoUpdate]
GO
ALTER TABLE [KS_UserGroup] ADD  DEFAULT ((0)) FOR [AutoUpdateText]
GO
ALTER TABLE [KS_UserGroup] ADD  DEFAULT ((0)) FOR [AutoUpdateScore]
GO
ALTER TABLE [KS_UserGroup] ADD  DEFAULT ((0)) FOR [AutoUpdateCharge]
GO
ALTER TABLE [KS_UserLoginLog] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_UserLoginLog] ADD  DEFAULT ((0)) FOR [loginFrom]
GO
ALTER TABLE [KS_UserLoginLog] ADD  DEFAULT ((0)) FOR [DeviceType]
GO
ALTER TABLE [KS_UserMobileLog] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_UserMobileLog] ADD  DEFAULT ((0)) FOR [DeviceType]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [TypeID]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [ClassID]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [Hit]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [Fund]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [PageSize]
GO
ALTER TABLE [KS_UserPhotos] ADD  DEFAULT ((0)) FOR [Model]
GO
ALTER TABLE [KS_UserRecord] ADD  CONSTRAINT [DF_KS_UserRecord_flag]  DEFAULT ((0)) FOR [flag]
GO
ALTER TABLE [KS_UserRecord] ADD  CONSTRAINT [DF_KS_UserRecord_adddate]  DEFAULT (getdate()) FOR [adddate]
GO
ALTER TABLE [KS_UserRecord] ADD  CONSTRAINT [DF_KS_UserRecord_userid]  DEFAULT ((0)) FOR [userid]
GO
ALTER TABLE [KS_UserVipCard] ADD  DEFAULT ((0)) FOR [MustInputRecommender]
GO
ALTER TABLE [KS_ViewRecords] ADD  CONSTRAINT [DF_KS_ViewRecords_basicType]  DEFAULT ((0)) FOR [basicType]
GO
ALTER TABLE [KS_ViewRecords] ADD  CONSTRAINT [DF_KS_ViewRecords_channelid]  DEFAULT ((0)) FOR [channelid]
GO
ALTER TABLE [KS_ViewRecords] ADD  CONSTRAINT [DF_KS_ViewRecords_infoid]  DEFAULT ((0)) FOR [infoid]
GO
ALTER TABLE [KS_ViewRecords] ADD  CONSTRAINT [DF_KS_ViewRecords_adddate]  DEFAULT (getdate()) FOR [adddate]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF__KS_Vote__BeginDa__19AACF41]  DEFAULT (getdate()) FOR [BeginDate]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF__KS_Vote__ExpireD__1A9EF37A]  DEFAULT (getdate()) FOR [ExpireDate]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF__KS_Vote__VoteTyp__1B9317B3]  DEFAULT ((0)) FOR [VoteType]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF__KS_Vote__LimitIP__1C873BEC]  DEFAULT ((0)) FOR [LimitIP]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF__KS_Vote__UserTF__1D7B6025]  DEFAULT ((0)) FOR [UserTF]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF_KS_Vote_ItemID]  DEFAULT ((0)) FOR [InfoID]
GO
ALTER TABLE [KS_Vote] ADD  CONSTRAINT [DF_KS_Vote_VoteScore]  DEFAULT ((0)) FOR [VoteScore]
GO
ALTER TABLE [KS_VoteItem] ADD  CONSTRAINT [DF__KS_VoteIt__VoteI__2057CCD0]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_VoteItem] ADD  CONSTRAINT [DF__KS_VoteIt__VoteN__214BF109]  DEFAULT ((0)) FOR [VoteNum]
GO
ALTER TABLE [KS_VoteLog] ADD  CONSTRAINT [DF__KS_VoteLo__VoteI__24285DB4]  DEFAULT ((0)) FOR [VoteID]
GO
ALTER TABLE [KS_VoteLog] ADD  CONSTRAINT [DF_KS_VoteLog_VoteDate]  DEFAULT (getdate()) FOR [VoteDate]
GO
ALTER TABLE [KS_WeiXinGroupInfo] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_IsKeyWord]  DEFAULT ((0)) FOR [IsKeyWord]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_Type]  DEFAULT ((0)) FOR [Type]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_Picmsg]  DEFAULT ((0)) FOR [Picmsg]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_Hits]  DEFAULT ((0)) FOR [Hits]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  CONSTRAINT [DF_KS_WeixinKeyWord_TypeFlag]  DEFAULT ((0)) FOR [TypeFlag]
GO
ALTER TABLE [KS_WeixinKeyWord] ADD  DEFAULT ((0)) FOR [CosType]
GO
ALTER TABLE [KS_WeixinMenu] ADD  CONSTRAINT [DF_KS_WeixinMenu_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_WeixinMenu] ADD  CONSTRAINT [DF_KS_WeixinMenu_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_WeixinMenu] ADD  CONSTRAINT [DF_KS_WeixinMenu_TypeFlag]  DEFAULT ((0)) FOR [TypeFlag]
GO
ALTER TABLE [KS_WeixinMenu] ADD  DEFAULT ((0)) FOR [CourseID]
GO
ALTER TABLE [KS_WeixinMenu] ADD  DEFAULT ((0)) FOR [CosType]
GO
ALTER TABLE [KS_WeixinMsg] ADD  CONSTRAINT [DF_KS_WeixinMsg_CreateTime]  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [KS_WeixinMsg] ADD  CONSTRAINT [DF_KS_WeixinMsg_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [KS_WeixinMsg] ADD  CONSTRAINT [DF_KS_WeixinMsg_ReplyTime]  DEFAULT (getdate()) FOR [ReplyTime]
GO
ALTER TABLE [KS_WeixinMsg] ADD  CONSTRAINT [DF_KS_WeixinMsg_IsRead]  DEFAULT ((0)) FOR [IsRead]
GO
ALTER TABLE [KS_WeixinMsg] ADD  DEFAULT ((0)) FOR [CosType]
GO
ALTER TABLE [KS_WeixinOpenuser] ADD  CONSTRAINT [DF_KS_WeixinOpenuser_Subscribe_Time]  DEFAULT (getdate()) FOR [Subscribe_Time]
GO
ALTER TABLE [KS_WeixinOpenuser] ADD  CONSTRAINT [DF_KS_WeixinOpenuser_Verify]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_WeixinOpenuser] ADD  CONSTRAINT [DF_KS_WeixinOpenuser_Flag]  DEFAULT ((0)) FOR [Flag]
GO
ALTER TABLE [KS_WeixinOpenuser] ADD  DEFAULT ((0)) FOR [SchoolID]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  CONSTRAINT [DF_KS_WeixinPigmsg_IsPic]  DEFAULT ((0)) FOR [IsPic]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  CONSTRAINT [DF_KS_WeixinPigmsg_ParentID]  DEFAULT ((0)) FOR [ParentID]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  CONSTRAINT [DF_KS_WeixinPigmsg_AddTime]  DEFAULT (getdate()) FOR [AddTime]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  CONSTRAINT [DF_KS_WeixinPigmsg_TypeFlag]  DEFAULT ((0)) FOR [TypeFlag]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  CONSTRAINT [DF_KS_WeixinPigmsg_Show_cover_pic]  DEFAULT ((0)) FOR [Show_cover_pic]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  DEFAULT ((0)) FOR [userID]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  DEFAULT ((0)) FOR [CourseID]
GO
ALTER TABLE [KS_WeixinPigmsg] ADD  DEFAULT ((0)) FOR [CosType]
GO
ALTER TABLE [KS_WeiXinQunFA] ADD  CONSTRAINT [DF_KS_WeiXinGroup_SendType]  DEFAULT ((0)) FOR [SendType]
GO
ALTER TABLE [KS_WeiXinQunFA] ADD  CONSTRAINT [DF_KS_WeiXinGroup_TypeFlag]  DEFAULT ((0)) FOR [TypeFlag]
GO
ALTER TABLE [KS_WeiXinQunFA] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_WeiXinQunFA] ADD  DEFAULT ((0)) FOR [CosType]
GO
ALTER TABLE [KS_WeixinTemplate] ADD  DEFAULT ((0)) FOR [TemplateType]
GO
ALTER TABLE [KS_WeixinTemplate] ADD  DEFAULT ((0)) FOR [IsDefault]
GO
ALTER TABLE [KS_WeixinTemplateClass] ADD  DEFAULT ((0)) FOR [ClassType]
GO
ALTER TABLE [KS_WeixinUser] ADD  CONSTRAINT [DF_KS_WeixinUser_WeiXinType]  DEFAULT ((0)) FOR [WeiXinType]
GO
ALTER TABLE [KS_WeixinUser] ADD  CONSTRAINT [DF_KS_WeixinUser_Verify]  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_WeixinUser] ADD  CONSTRAINT [DF_KS_WeixinUser_Access_YouXRQ]  DEFAULT (getdate()) FOR [Access_YouXRQ]
GO
ALTER TABLE [KS_WeixinUser] ADD  CONSTRAINT [DF_KS_WeixinUser_WeiXinStatus]  DEFAULT ((0)) FOR [WeiXinStatus]
GO
ALTER TABLE [KS_WeixinUser] ADD  CONSTRAINT [DF_KS_WeixinUser_TypeFlag]  DEFAULT ((0)) FOR [TypeFlag]
GO
ALTER TABLE [KS_WJanswer] ADD  CONSTRAINT [DF_KS_WJanswer_sjid]  DEFAULT ((0)) FOR [sjid]
GO
ALTER TABLE [KS_WJanswer] ADD  CONSTRAINT [DF_KS_WJanswer_typeid]  DEFAULT ((0)) FOR [typeid]
GO
ALTER TABLE [KS_WJanswer] ADD  CONSTRAINT [DF_KS_WJanswer_tmid]  DEFAULT ((0)) FOR [tmid]
GO
ALTER TABLE [KS_WJanswer] ADD  CONSTRAINT [DF_KS_WJanswer_tmtype]  DEFAULT ((0)) FOR [tmtype]
GO
ALTER TABLE [KS_WJanswer] ADD  CONSTRAINT [DF_KS_WJanswer_AddDate]  DEFAULT (getdate()) FOR [AddDate]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_IsIP]  DEFAULT ((0)) FOR [IsIP]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_IsLogin]  DEFAULT ((0)) FOR [IsLogin]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_IsAsk]  DEFAULT ((0)) FOR [IsAsk]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_IsList]  DEFAULT ((0)) FOR [IsList]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_point]  DEFAULT ((0)) FOR [point]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_OpenTimeLimit]  DEFAULT ((0)) FOR [OpenTimeLimit]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_dtfs]  DEFAULT ((0)) FOR [dtfs]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_verify]  DEFAULT ((0)) FOR [verify]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_hits]  DEFAULT ((0)) FOR [hits]
GO
ALTER TABLE [KS_WJItem] ADD  CONSTRAINT [DF_KS_Wenjian_answerNum]  DEFAULT ((0)) FOR [answerNum]
GO
ALTER TABLE [KS_WJRndZJ] ADD  CONSTRAINT [DF_KS_WJRndZJ_SJID]  DEFAULT ((0)) FOR [SJID]
GO
ALTER TABLE [KS_WJRndZJ] ADD  CONSTRAINT [DF_KS_WJRndZJ_TmType]  DEFAULT ((0)) FOR [TmType]
GO
ALTER TABLE [KS_WJRndZJ] ADD  CONSTRAINT [DF_KS_WJRndZJ_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_WJRndZJ] ADD  CONSTRAINT [DF_KS_WJRndZJ_FS]  DEFAULT ((0)) FOR [FS]
GO
ALTER TABLE [KS_WJRndZJ] ADD  CONSTRAINT [DF_KS_WJRndZJ_Num]  DEFAULT ((0)) FOR [Num]
GO
ALTER TABLE [KS_WJTK] ADD  CONSTRAINT [DF_KS_WJTK_TypeId]  DEFAULT ((0)) FOR [TypeId]
GO
ALTER TABLE [KS_WJTK] ADD  CONSTRAINT [DF_KS_WJTK_Tmtype]  DEFAULT ((0)) FOR [Tmtype]
GO
ALTER TABLE [KS_WJTK] ADD  CONSTRAINT [DF_KS_WJTK_OptionNum]  DEFAULT ((0)) FOR [OptionNum]
GO
ALTER TABLE [KS_WJTK] ADD  CONSTRAINT [DF_KS_WJTK_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_WorkTable] ADD  CONSTRAINT [DF_KS_WorkTable_OrderID]  DEFAULT ((0)) FOR [OrderID]
GO
ALTER TABLE [KS_YunAPP] ADD  DEFAULT ((0)) FOR [YunAppID]
GO
ALTER TABLE [KS_YunAPP] ADD  DEFAULT ((0)) FOR [AppType]
GO
ALTER TABLE [KS_YunAPP] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_YunAPP] ADD  DEFAULT ((0)) FOR [IsInstall]
GO
ALTER TABLE [KS_YunOpenUser] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [KS_YunOpenUser] ADD  DEFAULT ((0)) FOR [Verify]
GO
ALTER TABLE [KS_YunOpenUser] ADD  DEFAULT ((0)) FOR [UserID]
GO
ALTER TABLE [KS_YunOpenUser] ADD  DEFAULT ((0)) FOR [KeTangJieWxID]
GO
