if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Cms_Catalog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Cms_Catalog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Cms_Comment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Cms_Comment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Cms_Resource]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Cms_Resource]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Cms_Special]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Cms_Special]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Address]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Address]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Catalog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Catalog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Comment]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Comment]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Resource]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Resource]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_SiteSetting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_SiteSetting]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_HtmlPage]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_HtmlPage]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Key]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Key]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_LockIP]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_LockIP]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_News]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_News]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Online]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Online]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Operation]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Operation]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Products]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Products]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_ResUpdateLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_ResUpdateLog]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Setting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Setting]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_SiteLinks]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_SiteLinks]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_SiteManager]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_SiteManager]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Style]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Style]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_User]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_User]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_GroupAccounts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_GroupAccounts]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_GroupDirAccess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_GroupDirAccess]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_GroupIPAccess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_GroupIPAccess]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_UserAccounts]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_UserAccounts]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_UserDirAccess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_UserDirAccess]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ftp_UserIPAccess]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ftp_UserIPAccess]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_NewsConfig]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_NewsConfig]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_NewsItem]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_NewsItem]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_SoftItem]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_SoftItem]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_SoftConfig]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_SoftConfig]
GO

CREATE TABLE [dbo].[Mesky_SoftConfig] (
	[id] [int] NULL ,
	[UseDownload] [int] NULL ,
	[RepeatDeal] [tinyint] NULL ,
	[isProgress] [tinyint] NULL ,
	[TrueAddress] [tinyint] NULL ,
	[setInterval] [int] NULL ,
	[MaxDownSize] [int] NULL ,
	[AllowDownExt] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilePrefix] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileSuffix] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isZipFile] [tinyint] NULL ,
	[ZipMode] [tinyint] NULL ,
	[ZipTimeout] [int] NULL ,
	[MaxZipsize] [int] NULL ,
	[AllowFileExt] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[WinRarPath] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[DownFilePath] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[ReadmePath] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[ReadmeFile] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[RarNoteFile] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[DownZipKey] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Mesky_SoftItem] (
	[ItemID] [int] IDENTITY (1, 1) NOT NULL ,
	[ItemName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteUrl] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[ChannelID] [int] NULL ,
	[CatalogID] [int] NULL ,
	[SpecialID] [int] NULL ,
	[StopItem] [tinyint] NULL ,
	[Encoding] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsDown] [tinyint] NULL ,
	[downid] [int] NULL ,
	[MaxAddress] [int] NULL ,
	[AutoClass] [tinyint] NULL ,
	[PathForm] [smallint] NULL ,
	[SaveFilePath] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[AutoRename] [tinyint] NULL ,
	[IsNowTime] [tinyint] NULL ,
	[AllHits] [int] NULL ,
	[star] [int] NULL ,
	[RemoveCode] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[lastime] [smalldatetime] NULL ,
	[RemoteListUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PaginalList] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsPagination] [tinyint] NULL ,
	[startid] [int] NULL ,
	[lastid] [int] NULL ,
	[FindListCode] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[FindInfoCode] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[downpage] [tinyint] NULL ,
	[RetuneClass] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[RemoveFile] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[strLeachName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[NamedDemourl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[strReplace] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[RootID] [int] NULL ,
	[CatalogName] [char] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[Depth] [int] NULL ,
	[iszhidin] [tinyint] NULL ,
	[zhidinstarid] [int] NULL ,
	[zhidinend] [int] NULL ,
	[zhidinurlstar] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


CREATE TABLE [dbo].[Mesky_NewsConfig] (
	[id] [int] NULL ,
	[stopGather] [tinyint] NULL ,
	[RepeatDeal] [tinyint] NULL ,
	[MaxPicSize] [int] NULL ,
	[AllowPicExt] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[setInterval] [int] NULL 
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Mesky_NewsItem] (
	[ItemID] [int] IDENTITY (1, 1) NOT NULL ,
	[ItemName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteUrl] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[ChannelID] [int] NULL ,
	[CatalogID] [int] NULL ,
	[SpecialID] [int] NULL ,
	[StopItem] [tinyint] NULL ,
	[Encoding] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsDown] [tinyint] NULL ,
	[AutoClass] [tinyint] NULL ,
	[PathForm] [smallint] NULL ,
	[IsNowTime] [tinyint] NULL ,
	[AllHits] [int] NULL ,
	[star] [int] NULL ,
	[RemoveCode] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[lastime] [smalldatetime] NULL ,
	[RemoteListUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PaginalList] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsPagination] [tinyint] NULL ,
	[startid] [int] NULL ,
	[lastid] [int] NULL ,
	[FindListCode] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[FindInfoCode] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[RetuneClass] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[IsNextPage] [tinyint] NULL ,
	[NamedDemourl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[strReplace] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[rootid] [int] NULL ,
	[CatalogName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Depth] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


INSERT [Mesky_NewsConfig] ( [id] , [stopGather] , [RepeatDeal] , [MaxPicSize] , [AllowPicExt] , [setInterval] ) VALUES ('1' , '0' , '0' , '5000' , 'gif|jpg|png|bmp|swf' , '1000')

GO

CREATE TABLE [dbo].[Mesky_Cms_Catalog] (
	[catalogID] [int] NOT NULL ,
	[catalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ParentID] [int] NULL ,
	[ParentStr] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Depth] [tinyint] NULL ,
	[RootID] [int] NULL ,
	[Child] [tinyint] NULL ,
	[Orders] [int] NULL ,
	[Readme] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResNum] [int] NULL ,
	[Setting] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[isUpdate] [tinyint] NULL ,
	[isShowOnTop] [tinyint] NULL ,
	[ename]  [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isShowAllRes] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Cms_Comment] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ResourceID] [int] NULL ,
	[ReTopic] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [varchar] (4800) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Email] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[IP] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[Graded] [int] NULL ,
	[SendMaster] [tinyint] NULL ,
	[Reply] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[ReDateAndTime] [datetime] NULL ,
	[isRead] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Cms_Resource] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[dTitle] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Title] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[sTitle] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[FontColor] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[FontType] [tinyint] NULL ,
	[isComment] [tinyint] NULL ,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[Excerpt] [varchar] (450) COLLATE Chinese_PRC_CI_AS NULL ,
	[md5] [varchar] (35) COLLATE Chinese_PRC_CI_AS NULL ,
	[SpecialID] [int] NULL ,
	[RootID] [tinyint] NULL ,
	[Depth] [tinyint] NULL ,
	[CatalogID] [int] NULL ,
	[CatalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SmallImg] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[Writer] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[nFrom] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[RedirectUrl] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Hits] [int] NULL ,
	[Keys] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[IndexKeys] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[isHtml] [tinyint] NULL ,
	[isHot] [tinyint] NULL ,
	[isTop] [tinyint] NULL ,
	[isBest] [tinyint] NULL ,
	[isPic] [tinyint] NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[isAuditing] [tinyint] NULL ,
	[ReadPermission] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PaginationType] [tinyint] NULL ,
	[MaxCharPerPage] [int] NULL ,
	[accessoryURL] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[MutualityDown] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[MutualityCms] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[CommentNum] [int] NULL ,
	[Grade] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Cms_Special] (
	[SpecialID] [int] IDENTITY (1, 1) NOT NULL ,
	[SpecialName] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[OrderID] [int] NULL ,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[SmallImg] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[RedirectUrl] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Down_Address] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ResourceID] [int] NULL ,
	[Name] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[Url] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[Hits] [int] NULL ,
	[SiteID] [int] NULL ,
	[DateAndTime] [smalldatetime] NULL ,
	[Special] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Down_Catalog] (
	[catalogID] [int] NOT NULL ,
	[catalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ParentID] [int] NULL ,
	[ParentStr] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Depth] [tinyint] NULL ,
	[RootID] [int] NULL ,
	[Child] [tinyint] NULL ,
	[Orders] [int] NULL ,
	[Readme] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResNum] [int] NULL ,
	[Setting] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[isUpdate] [tinyint] NULL ,
	[isShowOnTop] [tinyint] NULL ,
	[ename]  [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isShowAllRes] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Down_Comment] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ResourceID] [int] NULL ,
	[ReTopic] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [varchar] (4800) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Email] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[IP] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[Graded] [int] NULL ,
	[SendMaster] [tinyint] NULL ,
	[Reply] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[ReDateAndTime] [datetime] NULL ,
	[isRead] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Down_Resource] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[RootID] [tinyint] NULL ,
	[Depth] [tinyint] NULL ,
	[CatalogID] [int] NULL ,
	[CatalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResName] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResVer] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Keys] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[IndexKeys] [varchar] (3) COLLATE Chinese_PRC_CI_AS NULL ,
	[md5] [varchar] (35) COLLATE Chinese_PRC_CI_AS NULL ,
	[FontColor] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[FontType] [tinyint] NULL ,
	[ResLanguage] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResType] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResLicence] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResSize] [int] NULL ,
	[ResRank] [int] NULL ,
	[System] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[authorURL] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[authorEmail] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[RegURL] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SmallImg] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[PreviewImg] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Excerpt] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[UpdateTime] [datetime] NULL ,
	[HitsTotal] [int] NULL ,
	[HitsMonth] [int] NULL ,
	[DateMonth] [smalldatetime] NULL ,
	[HitsWeek] [int] NULL ,
	[DateWeek] [smalldatetime] NULL ,
	[HitsToday] [int] NULL ,
	[DateToday] [smalldatetime] NULL ,
	[UserPoints] [int] NULL ,
	[UserClass] [int] NULL ,
	[isHot] [tinyint] NULL ,
	[isTop] [tinyint] NULL ,
	[isBest] [tinyint] NULL ,
	[isError] [tinyint] NULL ,
	[isAuditing] [tinyint] NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[MutualityDown] [varchar] (1500) COLLATE Chinese_PRC_CI_AS NULL ,
	[MutualityCms] [varchar] (1500) COLLATE Chinese_PRC_CI_AS NULL ,
	[CommentNum] [int] NULL ,
	[Grade] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Down_SiteSetting] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[SiteName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteURL] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[DownloadName] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[DownloadURL] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[isLB] [tinyint] NULL ,
	[isDefault] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_HtmlPage] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[FileName] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Key] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[RegType] [int] NULL ,
	[RegCode] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[RegKey] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[RegDate] [datetime] NULL ,
	[RegDateMD5] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_LockIP] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ip1] [float] NULL ,
	[ip2] [float] NULL ,
	[sip1] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[sip2] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_News] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[Hits] [int] NULL ,
	[UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isType] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Online] (
	[id] [float] NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[userclass] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[ip] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[startime] [datetime] NULL ,
	[lastimebk] [datetime] NULL ,
	[browser] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[actCome] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserID] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Operation] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ProductID] [int] NULL ,
	[ProductName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Moneys] [smallmoney] NULL ,
	[Points] [int] NULL ,
	[Months] [int] NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[isAuditing] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Products] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ProductName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[SmallImg] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ForPrice] [smallmoney] NULL ,
	[FavPrice] [smallmoney] NULL ,
	[Points] [int] NULL ,
	[Months] [int] NULL ,
	[VipType] [tinyint] NULL ,
	[DateAndTime] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_ResUpdateLog] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[DateTime] [smalldatetime] NULL ,
	[updateResNum] [int] NULL ,
	[MaxResourceID] [int] NULL ,
	[strResID] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[LogType] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Setting] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Setting] [varchar] (4000) COLLATE Chinese_PRC_CI_AS NULL ,
	[KeyOne] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[MoreSite] [varchar] (800) COLLATE Chinese_PRC_CI_AS NULL ,
	[MordKey] [varchar] (800) COLLATE Chinese_PRC_CI_AS NULL ,
	[isDefault] [tinyint] NULL ,
	[DateAndTime] [smalldatetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_SiteLinks] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[SiteName] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteURL] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteAdmin] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteLogo] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Email] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[LinkType] [tinyint] NULL ,
	[isHot] [tinyint] NULL ,
	[isAuditing] [tinyint] NULL ,
	[DateAndTime] [datetime] NULL ,
	[Hits] [int] NULL ,
	[orders] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_SiteManager] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[PassWord] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isAdmin] [tinyint] NULL ,
	[Description] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[Permission] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[LastLogin] [datetime] NULL ,
	[LastActive] [datetime] NULL ,
	[LastLoginIP] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Logins] [int] NULL ,
	[isMultiLogin] [tinyint] NULL ,
	[SysUser] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_Style] (
	[StyleID] [int] IDENTITY (1, 1) NOT NULL ,
	[StyleName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Main] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_List] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Info] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Catalog] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_New] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Top] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Search] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_abc] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Down_Comment] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_Main] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_List] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_Info] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_Catalog] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_Search] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[Style_Cms_Comment] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [datetime] NULL ,
	[isDefault] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_User] (
	[UserID] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserEmail] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SubmitDownRes] [int] NULL ,
	[EmbodyDownRes] [int] NULL ,
	[DownCredited] [int] NULL ,
	[SubmitCmsRes] [int] NULL ,
	[EmbodyCmsRes] [int] NULL ,
	[CmsCredited] [int] NULL ,
	[CAPDateTime] [datetime] NULL ,
	[UserPassword] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TruePassword] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserSign] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserSex] [tinyint] NULL ,
	[JoinDate] [datetime] NULL ,
	[UserLogins] [int] NULL ,
	[LastLogin] [datetime] NULL ,
	[UserLastIP] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserState] [tinyint] NULL ,
	[UserClass] [int] NULL ,
	[UserBirthday] [smalldatetime] NULL ,
	[UserQuesion] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserAnswer] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserInfo] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserSetting] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserIM] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserViews] [int] NULL ,
	[VipType] [tinyint] NULL ,
	[VipstartDate] [datetime] NULL ,
	[VipendDate] [datetime] NULL ,
	[Points] [int] NULL ,
	[ftpstate] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ftp_GroupAccounts] (
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Access] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Notes] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ftp_GroupDirAccess] (
	[ID] [int] NOT NULL ,
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Access] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ftp_GroupIPAccess] (
	[ID] [int] NOT NULL ,
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Access] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ftp_UserAccounts] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PassType] [int] NULL ,
	[ChangePass] [bit] NULL ,
	[SKeyValues] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Access] [varchar] (300) COLLATE Chinese_PRC_CI_AS NULL ,
	[HomeDir] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Privilege] [int] NULL ,
	[LogMesFile] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Disable] [bit] NULL ,
	[NeedSecure] [bit] NULL ,
	[RelPaths] [bit] NULL ,
	[HideHidden] [bit] NULL ,
	[AlwaysLogin] [bit] NULL ,
	[MaxUsers] [int] NULL ,
	[MaxSpeedUp] [int] NULL ,
	[MaxSpeedDown] [int] NULL ,
	[MaxIP] [int] NULL ,
	[IdleTimeOut] [int] NULL ,
	[SessionTimeOut] [int] NULL ,
	[QuotaEnable] [bit] NULL ,
	[QuotaCurrent] [float] NULL ,
	[QuotaMax] [float] NULL ,
	[RatioType] [int] NULL ,
	[RatioUp] [int] NULL ,
	[RatioDown] [int] NULL ,
	[RatioCredit] [numeric](18, 5) NULL ,
	[Expiration] [datetime] NULL ,
	[Groups] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Notes] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mesky_Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mesky_UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mesky_UserID] [int] NULL 
) ON [PRIMARY]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Log]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Log]
GO

CREATE TABLE [dbo].[Mesky_Down_Log] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserID] [int] NULL ,
	[DateAndTime] [smalldatetime] NULL ,
	[ResourceID] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_Down_Log] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Log] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Log] ADD 
	CONSTRAINT [DF_Mesky_Down_Log_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO


CREATE TABLE [dbo].[ftp_UserDirAccess] (
	[ID] [int] NOT NULL ,
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Access] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ftp_UserIPAccess] (
	[ID] [int] NOT NULL ,
	[Name] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[Access] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_Cms_Catalog] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Cms_Catalog] PRIMARY KEY  CLUSTERED 
	(
		[catalogID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Cms_Comment] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Cms_Comment] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Cms_Resource] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Cms_Resource] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Cms_Special] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Cms_Special] PRIMARY KEY  CLUSTERED 
	(
		[SpecialID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Address] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Address] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Catalog] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Catalog] PRIMARY KEY  CLUSTERED 
	(
		[catalogID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Comment] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Comment] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Resource] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Resource] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_SiteSetting] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_SiteSetting] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_HtmlPage] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_HtmlPage] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Key] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Key] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_LockIP] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_LockIP] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_News] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_News] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Operation] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Operation] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Products] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Products] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_ResUpdateLog] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_ResUpdateLog] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Setting] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Setting] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_SiteLinks] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_SiteLinks] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_SiteManager] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_SiteManager] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Style] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Style] PRIMARY KEY  CLUSTERED 
	(
		[StyleID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_User] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_User] PRIMARY KEY  CLUSTERED 
	(
		[UserID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_GroupAccounts] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_GroupAccounts] PRIMARY KEY  CLUSTERED 
	(
		[Name]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_GroupDirAccess] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_GroupDirAccess] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_GroupIPAccess] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_GroupIPAccess] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_UserAccounts] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_UserAccounts] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_UserDirAccess] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_UserDirAccess] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[ftp_UserIPAccess] WITH NOCHECK ADD 
	CONSTRAINT [PK_ftp_UserIPAccess] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Cms_Catalog] ADD 
	CONSTRAINT [DF_Mesky_Cms_Catalog_ParentID] DEFAULT (0) FOR [ParentID],
	CONSTRAINT [DF_Mesky_Cms_Catalog_Depth] DEFAULT (0) FOR [Depth],
	CONSTRAINT [DF_Mesky_Cms_Catalog_Child] DEFAULT (0) FOR [Child],
	CONSTRAINT [DF_Mesky_Cms_Catalog_ResNum] DEFAULT (0) FOR [ResNum],
	CONSTRAINT [DF_Mesky_Cms_Catalog_isUpdate] DEFAULT (0) FOR [isUpdate],
	CONSTRAINT [DF_Mesky_Cms_Catalog_isShowOnTop] DEFAULT (1) FOR [isShowOnTop],
	CONSTRAINT [DF_Mesky_Cms_Catalog_isShowAllRes] DEFAULT (1) FOR [isShowAllRes]
GO

ALTER TABLE [dbo].[Mesky_Cms_Comment] ADD 
	CONSTRAINT [DF_Mesky_Cms_Comment_dateandtime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_Cms_Comment_SendMaster] DEFAULT (0) FOR [SendMaster],
	CONSTRAINT [DF_Mesky_Cms_Comment_ReDateAndTime] DEFAULT (getdate()) FOR [ReDateAndTime],
	CONSTRAINT [DF_Mesky_Cms_Comment_isRead] DEFAULT (0) FOR [isRead]
GO

ALTER TABLE [dbo].[Mesky_Cms_Resource] ADD 
	CONSTRAINT [DF_Mesky_Cms_Resource_TitleFontType] DEFAULT (0) FOR [FontType],
	CONSTRAINT [DF_Mesky_Cms_Resource_isComment] DEFAULT (0) FOR [isComment],
	CONSTRAINT [DF_Mesky_Cms_Resource_SpecialID] DEFAULT (0) FOR [SpecialID],
	CONSTRAINT [DF_Mesky_Cms_Resource_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_Cms_Resource_Hits] DEFAULT (0) FOR [Hits],
	CONSTRAINT [DF_Mesky_Cms_Resource_isHtml] DEFAULT (1) FOR [isHtml],
	CONSTRAINT [DF_Mesky_Cms_Resource_isHot] DEFAULT (0) FOR [isHot],
	CONSTRAINT [DF_Mesky_Cms_Resource_isTop] DEFAULT (0) FOR [isTop],
	CONSTRAINT [DF_Mesky_Cms_Resource_isBest] DEFAULT (0) FOR [isBest],
	CONSTRAINT [DF_Mesky_Cms_Resource_isPic] DEFAULT (0) FOR [isPic],
	CONSTRAINT [DF_Mesky_Cms_Resource_isAuditing] DEFAULT (0) FOR [isAuditing],
	CONSTRAINT [DF_Mesky_Cms_Resource_PaginationType] DEFAULT (0) FOR [PaginationType],
	CONSTRAINT [DF_Mesky_Cms_Resource_CommentNum] DEFAULT (0) FOR [CommentNum],
	CONSTRAINT [DF_Mesky_Cms_Resource_Grade] DEFAULT (0) FOR [Grade]
GO

ALTER TABLE [dbo].[Mesky_Cms_Special] ADD 
	CONSTRAINT [DF_Mesky_Cms_Special_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO

ALTER TABLE [dbo].[Mesky_Down_Address] ADD 
	CONSTRAINT [DF_Mesky_Down_Address_Hits] DEFAULT (0) FOR [Hits],
	CONSTRAINT [DF_Mesky_Down_Address_SiteID] DEFAULT (0) FOR [SiteID],
	CONSTRAINT [DF_Mesky_Down_Address_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF__Mesky_Dow__Speci__392E6792] DEFAULT (0) FOR [Special]
GO

ALTER TABLE [dbo].[Mesky_Down_Catalog] ADD 
	CONSTRAINT [DF_Mesky_down_Catalog_ParentID] DEFAULT (0) FOR [ParentID],
	CONSTRAINT [DF_Mesky_down_Catalog_Depth] DEFAULT (0) FOR [Depth],
	CONSTRAINT [DF_Mesky_down_Catalog_Child] DEFAULT (0) FOR [Child],
	CONSTRAINT [DF_Mesky_down_Catalog_ResNum] DEFAULT (0) FOR [ResNum],
	CONSTRAINT [DF_Mesky_Down_Catalog_isUpdate] DEFAULT (0) FOR [isUpdate],
	CONSTRAINT [DF_Mesky_Down_Catalog_isShowOnTop] DEFAULT (1) FOR [isShowOnTop],
	CONSTRAINT [DF_Mesky_Down_Catalog_isShowAllRes] DEFAULT (1) FOR [isShowAllRes]
GO

 CREATE  INDEX [Main] ON [dbo].[Mesky_Down_Catalog]([RootID], [Orders]) ON [PRIMARY]
GO

 CREATE  INDEX [ParentID] ON [dbo].[Mesky_Down_Catalog]([ParentID]) ON [PRIMARY]
GO

 CREATE  INDEX [Orders] ON [dbo].[Mesky_Down_Catalog]([Orders]) ON [PRIMARY]
GO

 CREATE  INDEX [Depth] ON [dbo].[Mesky_Down_Catalog]([Depth]) ON [PRIMARY]
GO

 CREATE  INDEX [Main1] ON [dbo].[Mesky_Down_Catalog]([Orders], [ParentID]) ON [PRIMARY]
GO

 CREATE  INDEX [Main2] ON [dbo].[Mesky_Down_Catalog]([Orders], [Depth], [RootID]) ON [PRIMARY]
GO

 CREATE  INDEX [RootID] ON [dbo].[Mesky_Down_Catalog]([RootID]) ON [PRIMARY]
GO

 CREATE  INDEX [Child] ON [dbo].[Mesky_Down_Catalog]([Child]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_Down_Comment] ADD 
	CONSTRAINT [DF_Mesky_Down_Comment_dateandtime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_Down_Comment_SendMaster] DEFAULT (0) FOR [SendMaster],
	CONSTRAINT [DF_Mesky_Down_Comment_ReDateAndTime] DEFAULT (getdate()) FOR [ReDateAndTime],
	CONSTRAINT [DF_Mesky_Down_Comment_isRead] DEFAULT (0) FOR [isRead]
GO

ALTER TABLE [dbo].[Mesky_Down_Resource] ADD 
	CONSTRAINT [DF_Mesky_Down_Resource_FontType] DEFAULT (0) FOR [FontType],
	CONSTRAINT [DF_Mesky_down_Resource_ResRank] DEFAULT (3) FOR [ResRank],
	CONSTRAINT [DF_Mesky_down_Resource_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_down_Resource_UpdateTime] DEFAULT (getdate()) FOR [UpdateTime],
	CONSTRAINT [DF_Mesky_down_Resource_HitsTotal] DEFAULT (0) FOR [HitsTotal],
	CONSTRAINT [DF_Mesky_down_Resource_HitsMonth] DEFAULT (0) FOR [HitsMonth],
	CONSTRAINT [DF_Mesky_Down_Resource_DateMonth] DEFAULT (getdate()) FOR [DateMonth],
	CONSTRAINT [DF_Mesky_down_Resource_HitsWeek] DEFAULT (0) FOR [HitsWeek],
	CONSTRAINT [DF_Mesky_Down_Resource_DateWeek] DEFAULT (getdate()) FOR [DateWeek],
	CONSTRAINT [DF_Mesky_down_Resource_HitsToday] DEFAULT (0) FOR [HitsToday],
	CONSTRAINT [DF_Mesky_Down_Resource_DateToday] DEFAULT (getdate()) FOR [DateToday],
	CONSTRAINT [DF_Mesky_down_Resource_UserPoints] DEFAULT (0) FOR [UserPoints],
	CONSTRAINT [DF_Mesky_down_Resource_UserClass] DEFAULT (0) FOR [UserClass],
	CONSTRAINT [DF_Mesky_down_Resource_isHot] DEFAULT (0) FOR [isHot],
	CONSTRAINT [DF_Mesky_down_Resource_isTop] DEFAULT (0) FOR [isTop],
	CONSTRAINT [DF_Mesky_down_Resource_isBest] DEFAULT (0) FOR [isBest],
	CONSTRAINT [DF_Mesky_Down_Resource_isError] DEFAULT (0) FOR [isError],
	CONSTRAINT [DF_Mesky_down_Resource_isAuditing] DEFAULT (0) FOR [isAuditing],
	CONSTRAINT [DF_Mesky_Down_Resource_CommentNum] DEFAULT (0) FOR [CommentNum],
	CONSTRAINT [DF_Mesky_Down_Resource_Grade] DEFAULT (0) FOR [Grade]
GO

 CREATE  INDEX [skycn_by_id] ON [dbo].[Mesky_Down_Resource]([ID], [ResName], [ResVer], [UpdateTime]) ON [PRIMARY]
GO

 CREATE  INDEX [MutualityDownRes] ON [dbo].[Mesky_Down_Resource]([ID], [ResName], [ResVer], [isAuditing]) ON [PRIMARY]
GO

 CREATE  INDEX [HitsTotal] ON [dbo].[Mesky_Down_Resource]([HitsTotal] DESC ) ON [PRIMARY]
GO

 CREATE  INDEX [UpdateTime] ON [dbo].[Mesky_Down_Resource]([UpdateTime] DESC ) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_Down_SiteSetting] ADD 
	CONSTRAINT [DF_Mesky_Down_SiteSetting_isLB] DEFAULT (1) FOR [isLB],
	CONSTRAINT [DF_Mesky_Down_SiteSetting_isDefault] DEFAULT (0) FOR [isDefault]
GO

ALTER TABLE [dbo].[Mesky_HtmlPage] ADD 
	CONSTRAINT [DF_Mesky_HtmlPage_DataAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO

ALTER TABLE [dbo].[Mesky_Key] ADD 
	CONSTRAINT [DF_Mesky_Key_Mesky_Reg] DEFAULT (0) FOR [RegType],
	CONSTRAINT [DF_Mesky_Key_RegDate] DEFAULT (getdate()) FOR [RegDate]
GO

ALTER TABLE [dbo].[Mesky_News] ADD 
	CONSTRAINT [DF_Mesky_News_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_News_Hits] DEFAULT (0) FOR [Hits],
	CONSTRAINT [DF_Mesky_News_isType] DEFAULT (1) FOR [isType]
GO

ALTER TABLE [dbo].[Mesky_Online] ADD 
	CONSTRAINT [DF_Mesky_Online_startime] DEFAULT (getdate()) FOR [startime],
	CONSTRAINT [DF_Mesky_Online_lastimebk] DEFAULT (getdate()) FOR [lastimebk]
GO

ALTER TABLE [dbo].[Mesky_Operation] ADD 
	CONSTRAINT [DF_Mesky_Operation_Points] DEFAULT (0) FOR [Points],
	CONSTRAINT [DF_Mesky_Operation_Months] DEFAULT (0) FOR [Months],
	CONSTRAINT [DF_Mesky_Operation_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO

ALTER TABLE [dbo].[Mesky_Products] ADD 
	CONSTRAINT [DF_Mesky_Products_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO

ALTER TABLE [dbo].[Mesky_Setting] ADD 
	CONSTRAINT [DF_Mesky_Setting_isDefault] DEFAULT (0) FOR [isDefault],
	CONSTRAINT [DF_Mesky_Setting_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO

ALTER TABLE [dbo].[Mesky_SiteLinks] ADD 
	CONSTRAINT [DF_Mesky_SiteLinks_LinkType] DEFAULT (0) FOR [LinkType],
	CONSTRAINT [DF_Mesky_SiteLinks_isHot] DEFAULT (0) FOR [isHot],
	CONSTRAINT [DF_Mesky_SiteLinks_isAuditing] DEFAULT (1) FOR [isAuditing],
	CONSTRAINT [DF_Mesky_SiteLinks_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_SiteLinks_Hits] DEFAULT (0) FOR [Hits],
	CONSTRAINT [DF_Mesky_SiteLinks_orders] DEFAULT (1) FOR [orders]
GO

ALTER TABLE [dbo].[Mesky_SiteManager] ADD 
	CONSTRAINT [DF_Mesky_SiteManager_isAdmin] DEFAULT (0) FOR [isAdmin],
	CONSTRAINT [DF_Mesky_SiteManager_LastLogin] DEFAULT (getdate()) FOR [LastLogin],
	CONSTRAINT [DF_Mesky_SiteManager_LastActive] DEFAULT (getdate()) FOR [LastActive],
	CONSTRAINT [DF_Mesky_SiteManager_Lasts] DEFAULT (0) FOR [Logins],
	CONSTRAINT [DF_Mesky_SiteManager_isMultiLogin] DEFAULT (0) FOR [isMultiLogin]
GO

ALTER TABLE [dbo].[Mesky_Style] ADD 
	CONSTRAINT [DF_Mesky_Style_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_Style_isDefault] DEFAULT (0) FOR [isDefault]
GO

ALTER TABLE [dbo].[Mesky_User] ADD 
	CONSTRAINT [DF_Mesky_User_SubmitDownRes] DEFAULT (0) FOR [SubmitDownRes],
	CONSTRAINT [DF_Mesky_User_EmbodyDownRes] DEFAULT (0) FOR [EmbodyDownRes],
	CONSTRAINT [DF_Mesky_User_DownCredited] DEFAULT (0) FOR [DownCredited],
	CONSTRAINT [DF_Mesky_User_SubmitCmsRes] DEFAULT (0) FOR [SubmitCmsRes],
	CONSTRAINT [DF_Mesky_User_EmbodyCmsRes] DEFAULT (0) FOR [EmbodyCmsRes],
	CONSTRAINT [DF_Mesky_User_CmsCredited] DEFAULT (0) FOR [CmsCredited],
	CONSTRAINT [DF_Mesky_User_CAPDateTime] DEFAULT (getdate()) FOR [CAPDateTime],
	CONSTRAINT [DF_Mesky_User_UserSex] DEFAULT (1) FOR [UserSex],
	CONSTRAINT [DF_Mesky_User_JoinDate] DEFAULT (getdate()) FOR [JoinDate],
	CONSTRAINT [DF_Mesky_User_UserLogins] DEFAULT (0) FOR [UserLogins],
	CONSTRAINT [DF_Mesky_User_LastLogin] DEFAULT (getdate()) FOR [LastLogin],
	CONSTRAINT [DF_Mesky_User_LockUser] DEFAULT (0) FOR [UserState],
	CONSTRAINT [DF_Mesky_User_UserClass] DEFAULT (0) FOR [UserClass],
	CONSTRAINT [DF_Mesky_User_UserViews] DEFAULT (0) FOR [UserViews],
	CONSTRAINT [DF_Mesky_User_VipType] DEFAULT (0) FOR [VipType],
	CONSTRAINT [DF_Mesky_User_startDate] DEFAULT (getdate()) FOR [VipstartDate],
	CONSTRAINT [DF_Mesky_User_endDate] DEFAULT (getdate()) FOR [VipendDate],
	CONSTRAINT [DF_Mesky_User_Points] DEFAULT (0) FOR [Points],
	CONSTRAINT [DF_Mesky_User_ftpstate] DEFAULT (0) FOR [ftpstate]
GO

ALTER TABLE [dbo].[ftp_UserAccounts] ADD 
	CONSTRAINT [DF_UserAccounts_PassType] DEFAULT (0) FOR [PassType],
	CONSTRAINT [DF_UserAccounts_ChangePass] DEFAULT (1) FOR [ChangePass],
	CONSTRAINT [DF_UserAccounts_Privilege] DEFAULT (0) FOR [Privilege],
	CONSTRAINT [DF_UserAccounts_Disable] DEFAULT (1) FOR [Disable],
	CONSTRAINT [DF_UserAccounts_NeedSecure] DEFAULT (1) FOR [NeedSecure],
	CONSTRAINT [DF_UserAccounts_RelPaths] DEFAULT (1) FOR [RelPaths],
	CONSTRAINT [DF_UserAccounts_HideHidden] DEFAULT (1) FOR [HideHidden],
	CONSTRAINT [DF_UserAccounts_MaxUsers] DEFAULT (0) FOR [MaxUsers],
	CONSTRAINT [DF_UserAccounts_MaxSpeedUp] DEFAULT (0) FOR [MaxSpeedUp],
	CONSTRAINT [DF_UserAccounts_MaxSpeedDown] DEFAULT ((-1)) FOR [MaxSpeedDown],
	CONSTRAINT [DF_UserAccounts_MaxIP] DEFAULT ((-1)) FOR [MaxIP],
	CONSTRAINT [DF_UserAccounts_IdleTimeOut] DEFAULT (600) FOR [IdleTimeOut],
	CONSTRAINT [DF_UserAccounts_SessionTimeOut] DEFAULT (0) FOR [SessionTimeOut],
	CONSTRAINT [DF_UserAccounts_QuotaEnable] DEFAULT (0) FOR [QuotaEnable],
	CONSTRAINT [DF_ftp2_UserAccounts_QuotaCurrent] DEFAULT (0) FOR [QuotaCurrent],
	CONSTRAINT [DF_ftp2_UserAccounts_QuotaMax] DEFAULT (0) FOR [QuotaMax],
	CONSTRAINT [DF_ftp2_UserAccounts_RatioType] DEFAULT (0) FOR [RatioType],
	CONSTRAINT [DF_ftp2_UserAccounts_RatioUp] DEFAULT (1) FOR [RatioUp],
	CONSTRAINT [DF_ftp2_UserAccounts_RatioDown] DEFAULT (1) FOR [RatioDown],
	CONSTRAINT [DF_ftp2_UserAccounts_RatioCredit] DEFAULT (0) FOR [RatioCredit],
	CONSTRAINT [DF_ftp2_UserAccounts_Expiration] DEFAULT (1980 - 1 - 1) FOR [Expiration]
GO

 CREATE  UNIQUE  INDEX [Pk_Name] ON [dbo].[ftp_UserAccounts]([Name]) ON [PRIMARY]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_GetFilter]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_GetFilter]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_GetItem]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_GetItem]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_GetLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_GetLog]
GO

CREATE TABLE [dbo].[Mesky_GetFilter] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ItemID] [int] NULL ,
	[ItemName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilterName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilterObject] [int] NULL ,
	[FilterType] [int] NULL ,
	[FilterContent] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilterA] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilterB] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilterReplace] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_GetItem] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ItemName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SiteUrl] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Description] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[rootID] [int] NULL ,
	[depth] [int] NULL ,
	[catalogID] [int] NULL ,
	[catalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SpecialID] [int] NULL ,
	[ListUrl] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListNum] [int] NULL ,
	[ListPaingType] [int] NULL ,
	[ListPagesA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListPagesB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListPaingStr] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ListPaingA] [int] NULL ,
	[ListPaingB] [int] NULL ,
	[ListPageStr] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[HrefA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[HrefB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[TitleA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[TitleB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ContentA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[ContentB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[AuthorType] [int] NULL ,
	[AuthorStr] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[AuthorA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[AuthorB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeType] [int] NULL ,
	[TimeStr] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[CopyFromType] [int] NULL ,
	[CopyFromStr] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CopyFromA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[CopyFromB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[KeyType] [int] NULL ,
	[KeyStr] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[KeyA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[KeyB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[articlePaingType] [int] NULL ,
	[articlePaingA] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[articlePaingB] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Flag] [int] NULL ,
	[PaginationType] [int] NULL ,
	[MaxCharPerPage] [int] NULL ,
	[isHot] [int] NULL ,
	[isTop] [int] NULL ,
	[isBest] [int] NULL ,
	[Hits] [int] NULL ,
	[isAuditing] [int] NULL ,
	[ScriptLable] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveFiles] [int] NULL ,
	[LastDate] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Mesky_GetLog] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ItemID] [int] NULL ,
	[ItemName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[rootID] [int] NULL ,
	[depth] [int] NULL ,
	[catalogID] [int] NOT NULL ,
	[catalogName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ResourceID] [int] NULL ,
	[Title] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[DateAndTime] [smalldatetime] NULL ,
	[Url] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[Result] [tinyint] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_GetFilter] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_GetFilter] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_GetItem] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_GetItem] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_GetLog] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_GetLog] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_GetFilter] ADD 
	CONSTRAINT [DF_Mesky_GetFilter_FilterObject] DEFAULT (1) FOR [FilterObject],
	CONSTRAINT [DF_Mesky_GetFilter_FilterType] DEFAULT (1) FOR [FilterType]
GO

ALTER TABLE [dbo].[Mesky_GetItem] ADD 
	CONSTRAINT [DF_Mesky_GetItem_SpecialID] DEFAULT (0) FOR [SpecialID],
	CONSTRAINT [DF_Mesky_GetItem_ListNum] DEFAULT (1) FOR [ListNum],
	CONSTRAINT [DF_Mesky_GetItem_ListPaingType] DEFAULT (0) FOR [ListPaingType],
	CONSTRAINT [DF_Mesky_GetItem_AuthorType] DEFAULT (0) FOR [AuthorType],
	CONSTRAINT [DF_Mesky_GetItem_TimeType] DEFAULT (0) FOR [TimeType],
	CONSTRAINT [DF_Mesky_GetItem_CopyFromType] DEFAULT (0) FOR [CopyFromType],
	CONSTRAINT [DF_Mesky_GetItem_KeyType] DEFAULT (0) FOR [KeyType],
	CONSTRAINT [DF_Mesky_GetItem_articlePaingType] DEFAULT (0) FOR [articlePaingType],
	CONSTRAINT [DF_Mesky_GetItem_Flag] DEFAULT (0) FOR [Flag],
	CONSTRAINT [DF_Mesky_GetItem_PaginationType] DEFAULT (0) FOR [PaginationType],
	CONSTRAINT [DF_Mesky_GetItem_MaxCharPerPage] DEFAULT (0) FOR [MaxCharPerPage],
	CONSTRAINT [DF_Mesky_GetItem_isHot] DEFAULT (0) FOR [isHot],
	CONSTRAINT [DF_Mesky_GetItem_isTop] DEFAULT (0) FOR [isTop],
	CONSTRAINT [DF_Mesky_GetItem_isBest] DEFAULT (0) FOR [isBest],
	CONSTRAINT [DF_Mesky_GetItem_Hits] DEFAULT (0) FOR [Hits],
	CONSTRAINT [DF_Mesky_GetItem_isAuditing] DEFAULT (0) FOR [isAuditing],
	CONSTRAINT [DF_Mesky_GetItem_SaveFiles] DEFAULT (0) FOR [SaveFiles],
	CONSTRAINT [DF_Mesky_GetItem_LastDate] DEFAULT (getdate()) FOR [LastDate]
GO

ALTER TABLE [dbo].[Mesky_GetLog] ADD 
	CONSTRAINT [DF_Mesky_GetLog_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
	CONSTRAINT [DF_Mesky_GetLog_Result] DEFAULT (0) FOR [Result]
GO


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Mesky_Down_Log]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Mesky_Down_Log]
GO

CREATE TABLE [dbo].[Mesky_Down_Log] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserID] [int] NULL ,
	[DateAndTime] [smalldatetime] NULL ,
	[ResourceID] [int] NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Mesky_Down_Log] WITH NOCHECK ADD 
	CONSTRAINT [PK_Mesky_Down_Log] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Mesky_Down_Log] ADD 
	CONSTRAINT [DF_Mesky_Down_Log_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime]
GO



if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SP_Mesky_showPage]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[SP_Mesky_showPage]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE SP_Mesky_showPage

  @Mesky_CurrentPage	INT,
  @Mesky_PageSize	INT,
  @Mesky_Field		VARCHAR(800),
  @Mesky_Table		VARCHAR(50),
  @Mesky_Where		VARCHAR(800),
  @Mesky_WhereOther	VARCHAR(800),
  @Mesky_OrderBy	VARCHAR(800),
  @Mesky_Id		VARCHAR(50),
  @Mesky_Size		VARCHAR(3),
  @Mesky_Order		VARCHAR(5)

AS

SET NOCOUNT ON
DECLARE @SQL NVARCHAR(4000)

IF @Mesky_CurrentPage=1
  SET @SQL='SELECT TOP '+CAST(@Mesky_PageSize AS VARCHAR)+' '+@Mesky_Field+' FROM '+@Mesky_Table+@Mesky_Where+' '+@Mesky_OrderBy
ELSE
  SET @SQL='SELECT TOP '+CAST(@Mesky_PageSize AS VARCHAR)+' '+@Mesky_Field+' FROM '+@Mesky_Table+' WHERE '+@Mesky_Id+@Mesky_Order+'(SELECT '+@Mesky_Size+'('+@Mesky_Id+')  FROM (SELECT TOP '+CAST(@Mesky_PageSize*(@Mesky_CurrentPage-1) AS VARCHAR)+' '+@Mesky_Id+' FROM '+@Mesky_Table+@Mesky_Where+' '+@Mesky_OrderBy+') AS tmpTable) '+@Mesky_WhereOther+' '+@Mesky_OrderBy

EXEC(@SQL)
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

INSERT [Mesky_SiteManager] ( [UserName] , [PassWord] , [isAdmin] , [Description] , [Permission] , [LastLogin] , [LastActive] , [LastLoginIP] , [Logins] , [isMultiLogin] ) VALUES ('admin' , '7a57a5a743894a0e' , 1 , '系统超级管理员' , '11,21,51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65' , '2005-05-21 16:42:37.810' , '2005-05-21 16:42:37.810' , '219.138.195.178' , 376 , 1 )

GO
 INSERT [Mesky_Setting] ( [Name] , [Setting] , [isDefault] , [DateAndTime] ) VALUES ( '默认设置' , '我爱IT网站管理系统{$}我爱IT网站资源下载管理系统{$}http://www.woiit.com{$}images/logo.gif{$}images/banner.gif{$}kittenchen{$}joocd@163.com{$}版权所有 Copyright &copy; 2001-2004 www.woiit.com, All Rights{$}我爱IT网络科技有限公司，我爱IT网站资源下载管理系统，第五网络下载系统，CMS，第五网络网络，整站系统，系统，网站制作，网站，设计，网页设计制作，软件{$}我爱IT网站资源下载管理系统是原第五网络下载系统的升级版，是国内使用最普及的一个建站系统之一。{$}127.0.0.1|mesky.net|woiit.com{$}admin/{$}12{$}1{$}14{$}0{$}0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,{$}1{$}1{$}1{$}1{$}1{$}600{$}Scripting.FileSystemObject{$}1{$}1{$}26{$}27{$}28{$}29{$}30{$}31{$}1{$}10{$}index.asp{$}5{$}2{$}50{$}500{$}50{$}1{$}1{$}1{$}1{$}1{$}3{$}46{$}1{$}1{$}1{$}50{$}51{$}52{$}1{$}mail.mesky.net{$}mesky{$}mesky{$}<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>注册信息</title>
<style type="text/css">
<!--
* {
	font-family: Verdana, "宋体";
	font-size: 9pt;
	line-height: 145%;
}
-->
</style>
</head>

<body>
<table width="98%"  border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td>{$username}，您好：<br>
    <br>　
    　欢迎您注册成为<a href="{$siteurl}" target="_blank">{$sitename}</a>的用户，我们为您提供最好的服务。<br>
    <br>　
    　下面是您的注册信息：<br>
    <br>　
    　用户名：{$username}<br>　
    　密　码：{$password}<br>　
    　邮　箱：{$useremail}<br>　
    　问　题：{$userquesion}<br>    　
    　答　案：{$useranswer}</td>
  </tr>
  <tr>
    <td align="center"><font color=red>再次感谢您注册本系统，让我们一起来建设这个网上家园！</font><br>
      <br>
    {$copyright}</td>
  </tr>
</table>
</body>
</html>{$}gif|jpg|asp|{$}200{$}update_temp{$}updatefiles/{$}2{$}1{$}64{$}65{$}3{$}html{$}0{$}500{$}default.html{$}catalog_down.html{$}downlist/r_{$id}_{$pages}.html{$}downlist/s_{$id}_{$pages}.html{$}downabc/abc_{$s}.html{$}downnew/{$s}_{$pages}.html{$}downtop/{$s}_{$pages}.html{$}downinfo/{$id}.html{$}A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,123,@{$}A1,B1,C1,D1,E1,F1,G1,H1,I1,J1,K1,L1,M1,N1,O1,P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1,Z1{$}0{$}3{$}{$}30{$}300{$}50{$}500{$}100{$}1{$}{$}90{$}91{$}92{$}93{$}94{$}default_Cms.html{$}catalog_Cms.html{$}cmslist/r_{$id}_{$pages}.html{$}cmslist/s_{$id}_{$pages}.html{$}cmsnew/{$s}_{$pages}.html{$}cmstop/{$s}_{$pages}.html{$}article/article_{$id}.html{$}DateAndTime{$}35{$}300{$}35{$}500{$}100{$}50{$}100{$}article.html{$}不详|佚名|admin|小张{$}本站原创|新浪科技{$}http://www.mesky.net|http://tech.sina.com.cn{$}1{$}115{$}116{$}117{$}118{$}119{$}120{$}1{$}1{$}0{$}/down/{$}RWAMLCDPR{$}     \\\|///
   \\  - -  //
    (  @ @  )
┏oOOo-(_)-oOOo━━━━━━━━→
┃欢迎你，来自%IP的朋友。
┃本服务器已经运行了%ServerDays天、%ServerHours小时、%ServerMins分钟、%ServerSecs秒
┃共有%loggedInAll total个用户登录，24小时内有%Unow个用户登录
┃上载文件%ServerFilesUp个，计%ServerKbUp Kb
┃下载软件%ServerFilesDown个，计%ServerKbDown Kb
┃你的FTP剩余空间：%QuotaLeft Kb
┃         Oooo  
┗ oooO━-(   )━━━━━━━→
   (   )   ) /  使用帐号:%Name
    \ (   (_/  我爱IT网络FTP服务器
     \_)      www.woiit.com{$}500{$}1024{$}256{$}5{$}600{$}600{$}0{$}134{$}135{$}136{$}138{$}138{$}5{$}匿名用户,一级会员,二级会员,三级会员,四级会员,五级会员{$}共享软件,免费软件,自由软件,试用软件,演示软件,商业软件{$}简体中文,繁体中文,英文,多国语言{$}国产软件,国外软件,汉化补丁,破解补丁,精品软件{$}Win2003,WinXP,Win2000,NT,WinME,Win9X,Dos,Linux,Unix,Mac,ASP环境,PHP环境,CGI环境{$}Win2003,WinXP,Win2000,NT,WinME{$}妈妈的,我靠,fuck,bitch,他妈的,性爱,法轮,falundafa,falun,江泽民,操你妈,三级片,王八蛋{$}小张,mesky,大白兔{$}148{$}149{$}150{$}151{$}152{$}153{$}154{$}155' , 1 , '2005-02-14 16:03:00' )
GO

 INSERT [Mesky_Down_SiteSetting] ( [SiteName] , [SiteURL] , [Description] , [DownloadName] , [DownloadURL] , [isLB] , [isDefault] ) VALUES ('天空软件站' , 'http://www.skycn.com' , '天空软件站' , '新疆乌市下载,江苏常州下载,天津热线下载,扬州热线下载,云南网通下载,淄博通信下载,河南铁通下载,深圳长宽下载,河南南阳下载,奎屯铁通下载,天津铁通下载,江苏铁通下载,邯郸网通下载,四川铁通下载,四川绵阳下载,成都长宽下载,成都长丰下载,重庆铁通下载,广东佛山下载,通化网通下载,青岛网通下载,陕西联通下载,重庆联通下载,淄博网通下载,方宽专用下载' , 'http://xjrx-http.skycn.com:8181,http://js-http.skycn.net:8181,http://tj-http.skycn.net:8081,http://yz-http.skycn.net:8081,http://yncnc.downloadsky.com:8080,http://sd-http.skycn.net:8180,http://zztl-http.skycn.net:8181,http://szgwbn.downloadsky.com:8181,http://hn-http.skycn.net:8080,http://xjtt.downloadsky.com:8081,http://tjtt-http.skycn.net:8080,http://jstt.downloadsky.com:8081,http://hdt.downloadsky.com:8080,http://xbol-http.skycn.net:8081,http://scmy.downloadsky.com,http://cdgwbn.downloadsky.com:8080,http://cdcfc-http.downloadsky.com:8080,http://cqol.downloadsky.com:8181,http://gd-http.skycn.net:8081,http://jlth-http.downloadsky.com:8080,http://qdcnc-http.skycn.net:8180,http://ry165-http.skycn.net:8180,http://on165-http.skycn.net:8080,http://cbbn-http.downloadsky.com,http://fbn-http.downloadsky.com:8080' , 1 , 1 )
