dvbbs7.1.0 SP1的SQL版的数据库建库脚本

原创 2006年05月23日 13:35:00

在如下的内容的基础上作了一些内容的修改,可以用作dvbbs7.1.0 SP1的SQL版的数据库建库过程:

主要在david提供的脚本的基础上,在自己测试时又加了一些内容。

--create by david
--blog:http://blog.iyi.cn/david
--email:davidnick@126.com
--本程序仅供学习使用,请勿用于商业用途。如有需要请购买正版!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [Dv_MoneyLog] (
 [Log_ID] int IDENTITY (1, 1) NOT NULL CONSTRAINT PK_Dv_MoneyLog PRIMARY KEY,
 [ToolsID] int NOT NULL default 0,
 [CountNum] int NOT NULL default 0,
 [Log_Money] int NULL default 0,
 [Log_Ticket] int NULL default 0,
 [AddUserName] varchar (50) NULL ,
 [AddUserID] int NULL default 0,
 [Log_IP] varchar (40) NULL ,
 [Log_Time] smalldatetime NOT NULL default (getdate()),
 [Log_Type] tinyint NULL default 0,
 [BoardID] int NULL default 0,
 [Conect] text NULL ,
 [HMoney] varchar (250) NULL
 )

CREATE TABLE [Dv_Plus_Tools_MagicFace] (
 [ID] int IDENTITY (1, 1) NOT NULL CONSTRAINT PK_Dv_Plus_Tools_MagicFace PRIMARY KEY,
 [Title] varchar (50) NULL ,
 [MagicFace_s] int NULL ,
 [MagicFace_l] int NULL ,
 [MagicType] smallint  NULL ,
 [iMoney] int  NULL ,
 [iTicket] int  NULL,
 [tMoney] int  NULL ,
 [tTicket] int NULL ,
 [MagicSetting] varchar (255) NULL
 )

CREATE TABLE [Dv_Plus_Tools_Info] (
 [ID] int IDENTITY (1, 1) NOT NULL CONSTRAINT PK_Dv_Plus_Tools_Info PRIMARY KEY,
 [ToolsName] varchar (50) NULL ,
 [ToolsInfo] varchar (255) NULL ,
 [ToolsImg] varchar (150) NULL ,
 [IsStar] smallint NOT NULL default 1,
 [SysStock] int NOT NULL default 0,
 [UserStock] int NOT NULL default 0,
 [UserTicket] int NOT NULL default 0,
 [UserMoney] int NOT NULL default 0,
 [UserPost] int NOT NULL default 0,
 [UserWealth] int NOT NULL default 0,
 [UserEp] int NOT NULL default 0,
 [UserCp] int NOT NULL default 0,
 [UserGroupID] varchar (255) NULL ,
 [BoardID] text NULL ,
 [BuyType] tinyint NOT NULL default 0,
 [ToolsSetting] text
 )

CREATE TABLE [Dv_Plus_Tools_Buss] (
 [ID] int IDENTITY (1, 1) NOT NULL CONSTRAINT PK_Dv_Plus_Tools_Buss PRIMARY KEY,
 [UserID] int NOT NULL ,
 [UserName] varchar (50) NOT NULL ,
 [ToolsID] int NOT NULL ,
 [ToolsName] varchar (50) NOT NULL ,
 [ToolsCount] int NOT NULL default 0,
 [SaleCount] int NOT NULL default 0,
 [UpdateTime] datetime default (getdate()),
 [SaleMoney] int NOT NULL default 0,
 [SaleTicket] int NOT NULL default 0
 )
GO

 

CREATE TABLE [Dv_BbsLink] (
 [id] [int] NOT NULL ,
 [boardname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [readme] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [url] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
 [logo] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [islogo] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_BbsNews] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [boardid] [int] NULL ,
 [title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
 [username] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [addtime] [datetime] NULL ,
 [bgs] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_BestTopic] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [Announceid] [int] NULL ,
 [RootID] [int] NULL ,
 [BoardID] [int] NULL ,
 [Title] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [PostUserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [PostUserID] [int] NULL ,
 [DateAndTime] [datetime] NULL ,
 [Expression] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Board] (
 [boardid] [int] NOT NULL ,
 [BoardType] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [ParentID] [int] NOT NULL ,
 [ParentStr] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [Depth] [smallint] NULL ,
 [RootID] [int] NULL ,
 [Child] [smallint] NULL ,
 [readme] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [BoardMaster] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [PostNum] [int] NULL ,
 [TopicNum] [int] NULL ,
 [indexIMG] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [todayNum] [int] NULL ,
 [boarduser] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [LastPost] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [Orders] [int] NULL ,
 [sid] [int] NULL ,
 [Board_Setting] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [Board_Ads] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [Board_user] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
 [IsGroupSetting] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
 [BoardTopStr] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [CID] [tinyint] NULL ,
 [Rules] text null
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_BoardPermission] (
 [Pid] [int] IDENTITY (1, 1) NOT NULL ,
 [BoardID] [int] NULL ,
 [GroupID] [int] NULL ,
 [PSetting] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_BookMark] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [username] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [url] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [topic] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [addtime] [datetime] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_ChallengeInfo] (
 [D_ForumID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_Password] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_RealName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_identityNo] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_sex] [varchar] (5) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_postcode] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_address] [varchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_receiver] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_email] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_forumname] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_forumurl] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_telephone] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_mobile] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_forumProvider] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_version] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [D_challengePassWord] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_ChanOrders] (
 [O_ID] [int] IDENTITY (1, 1) NOT NULL ,
 [O_type] [smallint] NULL ,
 [O_mobile] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [O_Username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [O_isApply] [tinyint] NULL ,
 [O_issuc] [tinyint] NULL ,
 [O_PayMoney] [float] NULL ,
 [O_Paycode] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
 [O_BoardID] [int] NULL ,
 [O_TopicID] [int] NULL ,
 [O_AddTime] [datetime] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Friend] (
 [F_id] [int] IDENTITY (1, 1) NOT NULL ,
 [F_username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_friend] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_addtime] [datetime] NULL ,
 [F_userid] [int] NULL ,
 [F_Mod] [tinyint] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_GroupName] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [GroupName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Log] (
 [l_id] [int] IDENTITY (1, 1) NOT NULL ,
 [l_announceid] [int] NULL ,
 [l_boardid] [int] NULL ,
 [l_touser] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [l_username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [l_content] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [l_addtime] [datetime] NULL ,
 [l_ip] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [l_type] [tinyint] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Message] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [sender] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [incept] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
 [flag] [int] NULL ,
 [sendtime] [datetime] NULL ,
 [delR] [int] NOT NULL ,
 [delS] [int] NOT NULL ,
 [isSend] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_Online] (
 [id] [float] NOT NULL ,
 [username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [userclass] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [stats] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [ip] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [actforip] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
 [startime] [datetime] NULL ,
 [lastimebk] [datetime] NULL ,
 [boardid] [int] NULL ,
 [browser] [varchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserGroupID] [int] NULL ,
 [actCome] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [userhidden] [int] NULL ,
 [userid] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Plus] (
 [ID] [int] IDENTITY (1, 1) NOT NULL ,
 [Plus_Type] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Plus_Name] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Isuse] [tinyint] NOT NULL ,
 [Plus_Setting] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Mainpage] [varchar] (100) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [IsShowMenu] [tinyint] NOT NULL ,
 [plus_adminpage] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [plus_id] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [plus_Copyright] [varchar] (200) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_Setup] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [Forum_Setting] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_ads] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Badwords] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_rBadword] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Maxonline] [int] NOT NULL ,
 [Forum_MaxonlineDate] [smalldatetime] NOT NULL ,
 [Forum_TopicNum] [int] NOT NULL ,
 [Forum_PostNum] [int] NOT NULL ,
 [Forum_TodayNum] [int] NOT NULL ,
 [Forum_UserNum] [int] NOT NULL ,
 [Forum_YesTerdayNum] [int] NOT NULL ,
 [Forum_MaxPostNum] [int] NOT NULL ,
 [Forum_MaxPostDate] [smalldatetime] NOT NULL ,
 [Forum_lastUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_LastPost] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_BirthUser] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Sid] [int] NOT NULL ,
 [Forum_Version] [varchar] (20) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_NowUseBBS] [varchar] (8) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_IsInstall] [tinyint] NOT NULL ,
 [Forum_challengePassWord] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Ad] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_ChanName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_ChanSetting] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_LockIP] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Cookiespath] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_Boards] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_alltopnum] [varchar] (250) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Forum_pack] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [Forum_Cid] [tinyint] NOT NULL ,
 [Forum_AvaSiteID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [Forum_AvaSign] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [Forum_AdminFolder] varchar(255) null,
 [Forum_BoardXML] text null,
 [Forum_Css] text null
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_SmallPaper] (
 [S_ID] [int] IDENTITY (1, 1) NOT NULL ,
 [S_BoardID] [int] NULL ,
 [S_UserName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [S_Title] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [S_Content] [varchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
 [S_Hits] [int] NULL ,
 [S_Addtime] [datetime] NULL
) ON [PRIMARY]
GO


CREATE TABLE [Dv_StyleHelp] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [StyleName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Main_Style] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Style_Pic] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_index] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_dispbbs] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_showerr] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_login] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_online] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_usermanager] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_fmanage] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_boardstat] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_paper_even_toplist] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_query] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_show] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_dispuser] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_help_permission] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_postjob] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_post] [text] COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [page_boardhelp] [text] COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_TableList] (
 [ID] [int] IDENTITY (1, 1) NOT NULL ,
 [TableName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [TableType] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Topic] (
 [TopicID] [int] IDENTITY (1, 1) NOT NULL ,
 [Title] [varchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Boardid] [int] NOT NULL ,
 [PollID] [int] NULL ,
 [LockTopic] [int] NOT NULL ,
 [Child] [int] NULL ,
 [PostUsername] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [PostUserid] [int] NOT NULL ,
 [DateAndTime] [datetime] NOT NULL ,
 [hits] [int] NOT NULL ,
 [Expression] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [VoteTotal] [int] NULL ,
 [LastPost] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [LastPostTime] [datetime] NOT NULL ,
 [istop] [tinyint] NOT NULL ,
 [isvote] [tinyint] NULL ,
 [isbest] [tinyint] NULL ,
 [PostTable] [varchar] (8) COLLATE Chinese_PRC_CI_AS NULL ,
 [SmsUserList] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [IsSmsTopic] [tinyint] NULL ,
 [LastSmsTime] [datetime] NULL ,
 [TopicMode] [tinyint] NULL ,
 [Mode] [smallint] NULL ,
 [GetMoney] int Not Null default 0,
 [UseTools] varchar(255) Null ,
 [GetMoneyType] tinyint Not Null default 0,
 [HideName] tinyint Not Null default 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_Upfile] (
 [F_ID] [int] IDENTITY (1, 1) NOT NULL ,
 [F_AnnounceID] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_BoardID] [int] NULL ,
 [F_UserID] [int] NULL ,
 [F_Username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_Filename] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_Viewname] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_FileType] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_Type] [smallint] NULL ,
 [F_FileSize] [int] NULL ,
 [F_Readme] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [F_DownNum] [int] NULL ,
 [F_ViewNum] [int] NULL ,
 [F_DownUser] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [F_Flag] [tinyint] NULL ,
 [F_AddTime] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_User] (
 [UserID] [int] IDENTITY (1, 1) NOT NULL ,
 [UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserPassword] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserEmail] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserPost] [int] NULL ,
 [UserTopic] [int] NULL ,
 [UserSign] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserSex] [tinyint] NULL ,
 [UserFace] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserWidth] [int] NULL ,
 [UserHeight] [int] NULL ,
 [UserIM] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [JoinDate] [smalldatetime] NULL ,
 [LastLogin] [datetime] NULL ,
 [UserLogins] [int] NULL ,
 [UserViews] [int] NULL ,
 [LockUser] [tinyint] NULL ,
 [UserClass] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserGroup] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [userWealth] [int] NULL ,
 [userEP] [int] NULL ,
 [userCP] [int] NULL ,
 [UserPower] [int] NULL ,
 [UserDel] [int] NULL ,
 [UserIsBest] [int] NULL ,
 [UserTitle] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserBirthday] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserQuesion] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserAnswer] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserLastIP] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserPhoto] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserFav] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserInfo] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [UserSetting] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserGroupID] [int] NOT NULL ,
 [TitlePic] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserHidden] [tinyint] NULL ,
 [UserMsg] [varchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
 [IsChallenge] [tinyint] NULL ,
 [UserMobile] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [TruePassWord] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserToday] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [homepage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [Oicq] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [reann] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [icq] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [msn] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [UserMoney] int Not Null default 0 ,
 [UserTicket] int Not Null default 0 ,
 [FollowMsgID] text Null ,
 [Vip_StarTime] smalldatetime Null ,
 [Vip_EndTime] smalldatetime Null
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_UserAccess] (
 [uc_UserID] [int] NULL ,
 [uc_BoardID] [int] NULL ,
 [uc_Setting] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_UserGroups] (
 [UserGroupID] [int] IDENTITY (1, 1) NOT NULL ,
 [title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [usertitle] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [GroupSetting] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [Orders] [smallint] NULL ,
 [MinArticle] [int] NULL ,
 [TitlePic] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [GroupPic] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [ParentGID] [int] NULL ,
 [IsSetting] varchar(50) null
) ON [PRIMARY]
GO

CREATE TABLE [Dv_Vote] (
 [voteid] [int] IDENTITY (1, 1) NOT NULL ,
 [vote] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [votenum] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [votetype] [int] NULL ,
 [LockVote] [int] NULL ,
 [voters] [int] NULL ,
 [TimeOut] [datetime] NULL ,
 [UArticle] [int] NULL ,
 [UWealth] [int] NULL ,
 [UEP] [int] NULL ,
 [UCP] [int] NULL ,
 [UPower] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_VoteUser] (
 [ID] [int] IDENTITY (1, 1) NOT NULL ,
 [VoteID] [int] NULL ,
 [UserID] [int] NULL ,
 [VoteDate] [datetime] NULL ,
 [VoteOption] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [Dv_admin] (
 [id] [int] IDENTITY (1, 1) NOT NULL ,
 [username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [password] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [flag] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [LastLogin] [datetime] NULL ,
 [LastLoginIP] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [adduser] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [AcceptIP] varchar(255) Null
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [Dv_help] (
 [H_ID] [int] IDENTITY (1, 1) NOT NULL ,
 [H_ParentID] [int] NULL ,
 [H_title] [varchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
 [H_content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [H_type] [tinyint] NULL ,
 [H_stype] [int] NULL ,
 [H_bgimg] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
 [H_Addtime] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dv_bbs1] (
 [AnnounceID] [int] IDENTITY (1, 1) NOT NULL ,
 [ParentID] [int] NOT NULL ,
 [BoardID] [int] NOT NULL ,
 [UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [Topic] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [Body] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
 [DateAndTime] [smalldatetime] NOT NULL ,
 [length] [int] NULL ,
 [RootID] [int] NOT NULL ,
 [layer] [smallint] NULL ,
 [orders] [int] NOT NULL ,
 [isbest] [tinyint] NULL ,
 [ip] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
 [Expression] [varchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
 [locktopic] [int] NOT NULL ,
 [signflag] [tinyint] NULL ,
 [emailflag] [tinyint] NULL ,
 [isagree] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [PostUserID] [int] NULL ,
 [IsAudit] [tinyint] NULL ,
 [IsUpload] [tinyint] NULL ,
 [PostBuyUser] [text] COLLATE Chinese_PRC_CI_AS NULL ,
 [Ubblist] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
 [GetMoney] int Not Null default 0 ,
 [UseTools] varchar(255) Null ,
 [GetMoneyType] tinyint Not Null default 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


ALTER TABLE [Dv_BestTopic] WITH NOCHECK ADD
 CONSTRAINT [PK_BestTopic] PRIMARY KEY  CLUSTERED
 (
  [id]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO


ALTER TABLE [Dv_StyleHelp] WITH NOCHECK ADD
 CONSTRAINT [PK_Dv_StyleHelp] PRIMARY KEY  CLUSTERED
 (
  [id]
 )  ON [PRIMARY]
GO

ALTER TABLE [Dv_TableList] WITH NOCHECK ADD
 CONSTRAINT [PK_TableList] PRIMARY KEY  CLUSTERED
 (
  [ID]
 )  ON [PRIMARY]
GO

ALTER TABLE [Dv_Topic] WITH NOCHECK ADD
 CONSTRAINT [PK_Topic] PRIMARY KEY  CLUSTERED
 (
  [TopicID]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO

ALTER TABLE [Dv_User] WITH NOCHECK ADD
 CONSTRAINT [PK_user] PRIMARY KEY  CLUSTERED
 (
  [UserID]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO

ALTER TABLE [Dv_help] WITH NOCHECK ADD
 CONSTRAINT [PK_Dv_help] PRIMARY KEY  CLUSTERED
 (
  [H_ID]
 )  ON [PRIMARY]
GO

ALTER TABLE [dv_bbs1] WITH NOCHECK ADD
 CONSTRAINT [PK_bbs1] PRIMARY KEY  CLUSTERED
 (
  [AnnounceID]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO


ALTER TABLE [Dv_BbsLink] ADD
 CONSTRAINT [DF_bbslink_islogo] DEFAULT (0) FOR [islogo]
GO

ALTER TABLE [Dv_BbsNews] ADD
 CONSTRAINT [DF_Dv_BbsNews_boardid] DEFAULT (0) FOR [boardid]
GO

ALTER TABLE [Dv_Board] ADD
 CONSTRAINT [DF_board_ParentID] DEFAULT (0) FOR [ParentID],
 CONSTRAINT [DF_board_Depth] DEFAULT (0) FOR [Depth],
 CONSTRAINT [DF_board_RootID] DEFAULT (0) FOR [RootID],
 CONSTRAINT [DF_board_Child] DEFAULT (0) FOR [Child],
 CONSTRAINT [DF_board_CID] DEFAULT (0) FOR [CID],
 CONSTRAINT [PK_board] PRIMARY KEY  NONCLUSTERED
 (
  [boardid]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO

ALTER TABLE [Dv_ChanOrders] ADD
 CONSTRAINT [DF_DV_ChanOrders_O_isApply] DEFAULT (0) FOR [O_isApply],
 CONSTRAINT [DF_DV_ChanOrders_O_issuc] DEFAULT (0) FOR [O_issuc],
 CONSTRAINT [DF_DV_ChanOrders_O_BoardID] DEFAULT (0) FOR [O_BoardID],
 CONSTRAINT [DF_DV_ChanOrders_O_TopicID] DEFAULT (0) FOR [O_TopicID],
 CONSTRAINT [DF_DV_ChanOrders_O_AddTime] DEFAULT (getdate()) FOR [O_AddTime]
GO

ALTER TABLE [Dv_Friend] ADD
 CONSTRAINT [DF_Friend_F_addtime] DEFAULT (getdate()) FOR [F_addtime],
 CONSTRAINT [DF__Dv_FriEnd__F_Mod__1387E197] DEFAULT (0) FOR [F_Mod]
GO

ALTER TABLE [Dv_Log] ADD
 CONSTRAINT [DF_log_l_addtime] DEFAULT (getdate()) FOR [l_addtime],
 CONSTRAINT [DF_log_l_type] DEFAULT (0) FOR [l_type]
GO

ALTER TABLE [Dv_Message] ADD
 CONSTRAINT [DF_message_delR] DEFAULT (0) FOR [delR],
 CONSTRAINT [DF_message_delS] DEFAULT (0) FOR [delS],
 CONSTRAINT [DF_message_isSend] DEFAULT (0) FOR [isSend],
 CONSTRAINT [PK_message] PRIMARY KEY  NONCLUSTERED
 (
  [id]
 ) WITH  FILLFACTOR = 90  ON [PRIMARY]
GO

 CREATE  INDEX [IX_message] ON [Dv_Message]([sender], [isSend], [delS]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_message_1] ON [Dv_Message]([incept], [isSend], [delR], [flag]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [read] ON [Dv_Message]([id], [sender], [incept]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Tools_UserID] ON [Dv_Plus_Tools_Buss]([UserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Tools_ToolsID] ON [Dv_Plus_Tools_Buss]([ToolsID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Buy_Tools] ON [Dv_Plus_Tools_Buss]([UserID], [ToolsID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [UserID] ON [Dv_MoneyLog]([AddUserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [BoardID] ON [Dv_MoneyLog]([BoardID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Log_Type] ON [Dv_MoneyLog]([Log_Type]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [ToolsID] ON [Dv_MoneyLog]([ToolsID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [UserTools] ON [Dv_MoneyLog]([ToolsID], [AddUserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Dv_UserMoney] ON [Dv_User]([UserMoney]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Dv_UserTicket] ON [Dv_User]([UserTicket]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [Dv_UserGroupID] ON [Dv_User]([UserGroupID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [PostUserID] ON [dv_bbs1]([PostUserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

ALTER TABLE [Dv_Online] ADD
 CONSTRAINT [DF_online_UserGroupID] DEFAULT (0) FOR [UserGroupID],
 CONSTRAINT [DF_online_userhidden] DEFAULT (2) FOR [userhidden],
 CONSTRAINT [DF_online_userid] DEFAULT (0) FOR [userid]
GO

 CREATE  INDEX [o_1] ON [Dv_Online]([id]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [o_2] ON [Dv_Online]([userid]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [o_3] ON [Dv_Online]([userid], [userhidden]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

ALTER TABLE [Dv_Setup] ADD
 CONSTRAINT [DF_Dv_Setup_Forum_Setting_1] DEFAULT ('') FOR [Forum_Setting],
 CONSTRAINT [DF_Dv_Setup_Forum_ads_1] DEFAULT ('') FOR [Forum_ads],
 CONSTRAINT [DF_Dv_Setup_Forum_Badwords_1] DEFAULT ('') FOR [Forum_Badwords],
 CONSTRAINT [DF_Dv_Setup_Forum_rBadword_1] DEFAULT ('') FOR [Forum_rBadword],
 CONSTRAINT [DF_Dv_Setup_Forum_Maxonline_1] DEFAULT (0) FOR [Forum_Maxonline],
 CONSTRAINT [DF_Dv_Setup_Forum_MaxonlineDate_1] DEFAULT (getdate()) FOR [Forum_MaxonlineDate],
 CONSTRAINT [DF_Dv_Setup_Forum_TopicNum_1] DEFAULT (0) FOR [Forum_TopicNum],
 CONSTRAINT [DF_Dv_Setup_Forum_PostNum_1] DEFAULT (0) FOR [Forum_PostNum],
 CONSTRAINT [DF_Dv_Setup_Forum_TodayNum_1] DEFAULT (0) FOR [Forum_TodayNum],
 CONSTRAINT [DF_Dv_Setup_Forum_UserNum] DEFAULT (0) FOR [Forum_UserNum],
 CONSTRAINT [DF_Dv_Setup_Forum_YesTerdayNum_1] DEFAULT (0) FOR [Forum_YesTerdayNum],
 CONSTRAINT [DF_Dv_Setup_Forum_MaxPostNum_1] DEFAULT (0) FOR [Forum_MaxPostNum],
 CONSTRAINT [DF_Dv_Setup_Forum_MaxPostDate_1] DEFAULT (getdate()) FOR [Forum_MaxPostDate],
 CONSTRAINT [DF_Dv_Setup_Forum_lastUser_1] DEFAULT ('') FOR [Forum_lastUser],
 CONSTRAINT [DF_Dv_Setup_Forum_LastPost_1] DEFAULT ('') FOR [Forum_LastPost],
 CONSTRAINT [DF_Dv_Setup_Forum_BirthUser] DEFAULT ('2003-10-13 15:03:00|') FOR [Forum_BirthUser],
 CONSTRAINT [DF_Dv_Setup_Forum_Sid_1] DEFAULT (1) FOR [Forum_Sid],
 CONSTRAINT [DF_Dv_Setup_Forum_Cid_1] DEFAULT (0) FOR [Forum_Cid],
 CONSTRAINT [DF_Dv_Setup_Forum_Version_1] DEFAULT ('') FOR [Forum_Version],
 CONSTRAINT [DF_Dv_Setup_Forum_NowUseBBS_1] DEFAULT ('dv_bbs1') FOR [Forum_NowUseBBS],
 CONSTRAINT [DF_Dv_Setup_Forum_IsInstall_1] DEFAULT (0) FOR [Forum_IsInstall],
 CONSTRAINT [DF_Dv_Setup_Forum_challengePassWord] DEFAULT ('') FOR [Forum_challengePassWord],
 CONSTRAINT [DF_Dv_Setup_Forum_Ad] DEFAULT ('') FOR [Forum_Ad],
 CONSTRAINT [DF_Dv_Setup_Forum_ChanName_1] DEFAULT ('') FOR [Forum_ChanName],
 CONSTRAINT [DF_Dv_Setup_Forum_ChanSetting_1] DEFAULT ('1,1,1,1,1,1,1,1,1,1,1,1,1') FOR [Forum_ChanSetting],
 CONSTRAINT [DF_Dv_Setup_Forum_LockIP] DEFAULT ('') FOR [Forum_LockIP],
 CONSTRAINT [DF_Dv_Setup_Forum_Cookiespath] DEFAULT ('/') FOR [Forum_Cookiespath],
 CONSTRAINT [DF_Dv_Setup_Forum_BoardS] DEFAULT ('') FOR [Forum_Boards],
 CONSTRAINT [DF_Dv_Setup_Forum_alltopnum] DEFAULT ('') FOR [Forum_alltopnum]
GO

ALTER TABLE [Dv_SmallPaper] ADD
 CONSTRAINT [DF_SmallPaper_S_Hits] DEFAULT (0) FOR [S_Hits],
 CONSTRAINT [DF_SmallPaper_S_Addtime] DEFAULT (getdate()) FOR [S_Addtime]
GO

ALTER TABLE [Dv_StyleHelp] ADD
 CONSTRAINT [DF_Dv_StyleHelp_StyleName] DEFAULT ('') FOR [StyleName],
 CONSTRAINT [DF__Dv_StyleHelp__page_m__69E6AD86] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [Main_Style],
 CONSTRAINT [DF_Dv_StyleHelp_Style_Pic] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [Style_Pic],
 CONSTRAINT [DF__Dv_StyleHelp__page_i__17786E0C] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_index],
 CONSTRAINT [DF__Dv_StyleHelp__page_d__3E082B48] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_dispbbs],
 CONSTRAINT [DF__Dv_StyleHelp__page_s__3FF073BA] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_showerr],
 CONSTRAINT [DF__Dv_StyleHelp__page_l__56D3D912] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_login],
 CONSTRAINT [DF__Dv_StyleHelp__page_o__74643BF9] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_online],
 CONSTRAINT [DF__Dv_StyleHelp__page_u__75586032] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_usermanager],
 CONSTRAINT [DF__Dv_StyleHelp__page_a__316D4A39] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_fmanage],
 CONSTRAINT [DF__Dv_StyleHelp__page_b__4850AF91] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_boardstat],
 CONSTRAINT [DF__Dv_StyleHelp__page_p__53C2623D] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_paper_even_toplist],
 CONSTRAINT [DF__Dv_StyleHelp__page_q__0371755F] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_query],
 CONSTRAINT [DF__Dv_StyleHelp__page_s__08362A7C] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_show],
 CONSTRAINT [DF__Dv_StyleHelp__page_d__0A1E72EE] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_dispuser],
 CONSTRAINT [DF__Dv_StyleHelp__page_h__0B129727] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_help_permission],
 CONSTRAINT [DF__Dv_StyleHelp__page_p__0C06BB60] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_postjob],
 CONSTRAINT [DF__Dv_StyleHelp__page_p__0CFADF99] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_post],
 CONSTRAINT [DF__Dv_StyleHelp__page_b__1293BD5E] DEFAULT ('|||@@@|||@@@|||@@@|||') FOR [page_boardhelp]
GO

ALTER TABLE [Dv_TableList] ADD
 CONSTRAINT [DF_TableList_TableName] DEFAULT ('') FOR [TableName],
 CONSTRAINT [DF_TableList_TableType] DEFAULT ('') FOR [TableType]
GO

ALTER TABLE [Dv_Topic] ADD
 CONSTRAINT [DF_Topic_PollID] DEFAULT (0) FOR [PollID],
 CONSTRAINT [DF_Topic_LockTopic] DEFAULT (0) FOR [LockTopic],
 CONSTRAINT [DF_Topic_Child] DEFAULT (0) FOR [Child],
 CONSTRAINT [DF_Topic_DateAndTime] DEFAULT (getdate()) FOR [DateAndTime],
 CONSTRAINT [DF_Topic_hits] DEFAULT (0) FOR [hits],
 CONSTRAINT [DF_Topic_VoteTotal] DEFAULT (0) FOR [VoteTotal],
 CONSTRAINT [DF_Topic_LastPostTime] DEFAULT (getdate()) FOR [LastPostTime],
 CONSTRAINT [DF_Topic_istop] DEFAULT (0) FOR [istop],
 CONSTRAINT [DF_Topic_isvote] DEFAULT (0) FOR [isvote],
 CONSTRAINT [DF_Topic_isbest] DEFAULT (0) FOR [isbest],
 CONSTRAINT [DF_Topic_IsSmsTopic] DEFAULT (0) FOR [IsSmsTopic],
 CONSTRAINT [DF_Topic_LastSmsTime] DEFAULT (getdate()) FOR [LastSmsTime],
 CONSTRAINT [DF_Topic_TopicMode] DEFAULT (0) FOR [TopicMode],
 CONSTRAINT [DF_Dv_Topic_Mode] DEFAULT (0) FOR [Mode]
GO

 CREATE  INDEX [list_1] ON [Dv_Topic]([Boardid], [istop], [LastPostTime]) ON [PRIMARY]
GO

 CREATE  INDEX [list_2] ON [Dv_Topic]([Boardid], [istop], [Mode], [LastPostTime]) ON [PRIMARY]
GO

 CREATE  INDEX [topicwithme] ON [Dv_Topic]([PostUserid], [Child]) ON [PRIMARY]
GO

 CREATE  INDEX [SearchUser] ON [Dv_Topic]([PostUserid]) ON [PRIMARY]
GO

 CREATE  INDEX [SearchTitle] ON [Dv_Topic]([Title]) ON [PRIMARY]
GO

ALTER TABLE [Dv_Upfile] ADD
 CONSTRAINT [DF_DV_Upfile_F_Type] DEFAULT (0) FOR [F_Type],
 CONSTRAINT [DF_DV_Upfile_F_DownNum] DEFAULT (0) FOR [F_DownNum],
 CONSTRAINT [DF_DV_Upfile_F_ViewNum] DEFAULT (0) FOR [F_ViewNum],
 CONSTRAINT [DF_DV_Upfile_F_Flag] DEFAULT (0) FOR [F_Flag],
 CONSTRAINT [DF_DV_Upfile_F_AddTime] DEFAULT (getdate()) FOR [F_AddTime]
GO

ALTER TABLE [Dv_User] ADD
 CONSTRAINT [DF_Dv_User_UserPost] DEFAULT (0) FOR [UserPost],
 CONSTRAINT [DF_Dv_User_UserTopic] DEFAULT (0) FOR [UserTopic],
 CONSTRAINT [DF_Dv_User_UserWidth] DEFAULT (0) FOR [UserWidth],
 CONSTRAINT [DF_Dv_User_UserHeight] DEFAULT (0) FOR [UserHeight],
 CONSTRAINT [DF_Dv_User_UserLogins] DEFAULT (0) FOR [UserLogins],
 CONSTRAINT [DF_Dv_User_UserViews] DEFAULT (0) FOR [UserViews],
 CONSTRAINT [DF_Dv_User_userWealth] DEFAULT (0) FOR [userWealth],
 CONSTRAINT [DF_Dv_User_userEP] DEFAULT (0) FOR [userEP],
 CONSTRAINT [DF_Dv_User_userCP] DEFAULT (0) FOR [userCP],
 CONSTRAINT [DF_user_UserPower] DEFAULT (0) FOR [UserPower],
 CONSTRAINT [DF_user_UserDel] DEFAULT (0) FOR [UserDel],
 CONSTRAINT [DF_user_UserIsBest] DEFAULT (0) FOR [UserIsBest],
 CONSTRAINT [DF_user_UserGroupID] DEFAULT (0) FOR [UserGroupID],
 CONSTRAINT [DF_user_UserHidden] DEFAULT (0) FOR [UserHidden],
 CONSTRAINT [DF_user_IsChallenge] DEFAULT (0) FOR [IsChallenge]
GO

 CREATE  INDEX [toplist_1] ON [Dv_User]([UserPost] DESC ) ON [PRIMARY]
GO

 CREATE  INDEX [IX_user] ON [Dv_User]([UserName]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [userinfo] ON [Dv_User]([UserGroupID], [UserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [userann] ON [Dv_User]([UserID], [UserClass]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [toplist_2] ON [Dv_User]([JoinDate] DESC ) ON [PRIMARY]
GO

 CREATE  INDEX [toplist_3] ON [Dv_User]([userWealth] DESC ) ON [PRIMARY]
GO

 CREATE  INDEX [chan_1] ON [Dv_User]([UserMobile], [IsChallenge]) ON [PRIMARY]
GO

 CREATE  INDEX [UserEmail] ON [Dv_User]([UserEmail]) ON [PRIMARY]
GO

 CREATE  INDEX [UserPer] ON [Dv_UserAccess]([uc_BoardID], [uc_UserID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

ALTER TABLE [Dv_UserGroups] ADD
 CONSTRAINT [DF_Dv_UserGroups1_MinArticle] DEFAULT (0) FOR [MinArticle],
 CONSTRAINT [DF_Dv_UserGroups1_ParentGID] DEFAULT (0) FOR [ParentGID]
GO

ALTER TABLE [Dv_Vote] ADD
 CONSTRAINT [DF_vote_votetype] DEFAULT (0) FOR [votetype],
 CONSTRAINT [DF_vote_LockVote] DEFAULT (0) FOR [LockVote],
 CONSTRAINT [DF_vote_voters] DEFAULT (0) FOR [voters],
 CONSTRAINT [DF_vote_TimeOut] DEFAULT (getdate()) FOR [TimeOut],
 CONSTRAINT [DF_Dv_Vote_UArticle] DEFAULT (0) FOR [UArticle],
 CONSTRAINT [DF_Dv_Vote_UWealth] DEFAULT (0) FOR [UWealth],
 CONSTRAINT [DF_Dv_Vote_UEP] DEFAULT (0) FOR [UEP],
 CONSTRAINT [DF_Dv_Vote_UCP] DEFAULT (0) FOR [UCP],
 CONSTRAINT [DF_Dv_Vote_UPower] DEFAULT (0) FOR [UPower]
GO

ALTER TABLE [Dv_VoteUser] ADD
 CONSTRAINT [DF_voteuser_VoteDate] DEFAULT (getdate()) FOR [VoteDate]
GO

ALTER TABLE [Dv_admin] ADD
 CONSTRAINT [DF_admin_LastLogin] DEFAULT (getdate()) FOR [LastLogin]
GO

ALTER TABLE [Dv_help] ADD
 CONSTRAINT [DF_dv_help_H_type] DEFAULT (0) FOR [H_type],
 CONSTRAINT [DF_dv_help_H_orders] DEFAULT (0) FOR [H_stype],
 CONSTRAINT [DF_dv_help_H_Addtime] DEFAULT (getdate()) FOR [H_Addtime]
GO

 CREATE  INDEX [IX_Dv_help] ON [Dv_help]([H_ParentID]) ON [PRIMARY]
GO

ALTER TABLE [dv_bbs1] ADD
 CONSTRAINT [DF_bbs1_ParentID] DEFAULT (0) FOR [ParentID],
 CONSTRAINT [DF_bbs1_locktopic] DEFAULT (0) FOR [locktopic],
 CONSTRAINT [DF_bbs1_IsAudit] DEFAULT (0) FOR [IsAudit],
 CONSTRAINT [DF_bbs1_IsUpload] DEFAULT (0) FOR [IsUpload]
GO

 CREATE  INDEX [dispbbs] ON [dv_bbs1]([BoardID], [RootID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [save_1] ON [dv_bbs1]([RootID], [orders]) ON [PRIMARY]
GO

 CREATE  INDEX [disp] ON [dv_bbs1]([BoardID]) ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO

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

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

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

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

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  OFF
GO

/*exec(decrypt(0x05DFAFE2EA011E8170DB61CDBD44CBB443A1B23A54832C084946AE1CA708FE27FC167EC1ED7176880BC7142CAE0748012EF30B6972996CFC39DAEE00E57828F2E0E7F13486381337B91DD6A22C5D0AF4BA0D0470D6803305E5D38D1B278A5515014FF40B41B5243302C7F451C3763606DB70083C732E6D4C8D6F792770B602BC6E2B429A8825437247E58F1857EDD517C06D860CCDE0E153AA2AC9DAC4BBF49A42F92D3C2C7950A2F2CFBCF2D8258109D32297712E97A71E8F9F120F36445DFA7C2B3E8C57D110508AA0A61DFECFD6457B3626341DA5488702ABEEB7ABF6BFB7A79762D3AED205D454FF0D634C2BB00E625E99E2DC47212184FA672B1D094C9620C1712AC4A9FEA1151DCF6BF5DA30582A910CD66C151B9D0F890FF63F91D066ED0DBF5E2DDB0D2D13EFFCCFF0CA3E3B2ACC0A0EF8ECBD4151DE3BFA40212BE99D2D7D5D13F624010DE8625A124262E893447A2C5949AA197FF08641950241BC93A0C58D879884FDFEBBB0FE34F07F5D25F6B26C0D25198933BC46B92DE24C290DBF2A666EBB26E31741144C917821E6363022E503FBEF9EC33ED095343FA2DFD526A3B2EDAE3FE5462F787573D62AD9490C952131CA722B6A341B823EF7F9BF50AA90348254ABA7197FAAECCED877D04EEA027D9C9534194AF23E0E4EFE682911FA43EBB10EAD42A936E8623CACA2CCA0C69BD98171B9D1C760825F1DC74399250ACC995A18BAA2ED66375CEA33283248C41A9055354B3C968850CB289DB581E97C3B9959EA7B61D727800B7F2B84C78569A0E89742DE8BB9804F5DCBCDFA7D28DD7D6144D1324CDE46B2A5C188853A0C659CA8481349DBEAC2023E448B75A9CC4291F1E734C11D90BE85AEC537ABADA34631CF74947835153CDDEE73C2DDDDDEC8011A067A2ACF82BB6BE7125F47114F3FEB3E6075C1D1130923C3EF7F936A1BAF0F314B0CC37830F8E40B5A57BC0ADD99B36DB9729354D10C235BFDAE4BB79E0B8B2612BA216A1D3CA82B48710253C087212F786791617F17AD3F24BFB1072110ADA07D70B0028D94EE35396F00C01E1C38072EE70D3EEB691A0A9C4E52D89802E238AB390ABDF0F2D5B5C96410C87956D2287B388E3FC267BD69EADAFE93B8FE3587A24AF199B1A81B18539C1C21034C680DC89F10557804FFBCA956235D37DC7659A8C05CCC7BF6662FF71EE9A749D9C1B8F87EA93D7657740BF49C0D9417B53C9C0B10A5F644D663C5BC724B18CF58C82E12C38CA1B51BE97AB8D63E31A23765DEE55980EC90E4CAA7CC8468CA36991C8F83AA3527F2C6D5C88AEE5650B650935AEDF5A092071AAB13EE8411469C88A69F9CF67BD59CBB67BBF14A3CC5547EAA140908563D1830FA91B7D03AC220D065999B2C5F0323799460831D92A429D327A4B4FB615E6C372BA04589698CDE35B1FE647BCB66C4425B1AA2612029821C6BFEF97AB3A25E70987894F2C4023B03BAB10D979AB561C7921ACA8095B957A98C512312F72B045605570B05EF817A237A7A3C23A406449DDB42CF99D6E8FCBA8375E84494B5ACD7A6D4DBC3FC784A827BAF54A633B3356FBC1D4C2BF30086DC30596FA338A835DCF171D7144D1A8354C9525E013553B247A0DD39C6A7D4B6B87EC6D855A3407D2CE6576361FEFE394E2970E7256E0544B3E6F1DE57E0D14309E9D8059FD2C5BDA303B669A1000FF4FF3A2F5D104F5A164E1C2389D66C1F71F8421BCED59D8CDEF72DDC0116FFFC4DB87A15AC667A44CE2DD55AAC58B0C4BFC3D6118EA33FD3569260892D0FEC8571CD8168B2ED2F76C636E3B2691FBACFEE1C48AE1A8EE205C464E047EEFEEA83CFA24316C2A05E9C0F9A52AEAD1B851F063BC74BC560037F5771257B78CDC9CE31C83AC81121759CFCEB06F7B33FF591F83C8E0E211E7ED1A43929745AB22AEA0B38D4A7B04CED3F2566AC9A535977EA3BA89800111E544CEE1B05B5EA8AED65C50B8AB52582377FB72CD06571934B75D5BDA037A2706D657E929B89DA9B4C80CDF67201031A97C0AE8ABD4A4C2632AF786360109B4E37655E90E5B1E4410A89275777AF117754230BDD5A984783F7B9E9B87A2D41729D3C4DCDF56460227621D9CF2267033A5358A0686899013B738F7D86D55BD852F3CEFFF59119FCA00A2D69BABA754EE3AB4D80573381233F71B85310D8CF5FD5AD922B8716495CD9A58358C307F3191881D079DFEFAC9CF371ED9BC34CFF320D6A8442CC1B81045C3EC53191BE924F70E9951B7F3E39AAB84057B5756B2D39AC34BC3979F3900B6AD69ED3709B6A368AFF96DA24BF725D7602CF0C6DC76B3198100BA75B1C011D4062376473FFFE3FB5B0622F6B3D50C7D44F66AAE924E7199288BF74176BDFDBE77BFED1C71DD359A86116E565455F1FAB4F94952F5E9AEBFCAFA444DEAA278832033680CA5C2B0070CB2B57198C96EB7E0485567F773EC8D860575F70624574A27E981207BA00BEA5614F78FFF37367BDFE905B7ACCEE1224EA1F2D6F285FA8E6F82DEA63FEB5376E5AD10CD4ACEC6194316963586E909C2473349E97699261CD3B9821EC1A537A801B33EA36BBF921AA69E31E944DAB4E105AA569B2A0C82097B0405034E7AB47DE683E992DD87B716A045A93B8CD9A8A846D11A9609BE50BE049EABD21EDB27893E1A1FF53E9790CA26EE3996BE8C47F66E1C9D5E2A8FC1AF5A14960129C3C87622EA59817F259082AC9B93EDABE6B0AC5C031D3BAC527BBEA39B0407E8B8A8FCDF22FEF4035775B0FCBA881DE261CE9701B65727BEFF9798E4E99FA4EED179DDB6012459344812029EE7681A475393D4E6099E74DFE1720E7BCB1A3B639E27772CE5BEF92B4632A3C855621201E1C62BB2DD2729887B27F292779CAFCB874CB2AE420B8D3596C0BD322A8FF70E2D311843C5FE6567DD83B6643B79E29E02BB8B25FB4D64D29B176F2F12C98447D2AE3EF470AE54E55D9381782A3F123FF8CDFEBC66BD0ADD021F7D0C5F0AC5986C7CCF4E2D17002B12A25FD5D0FCE6C2C1E750878E1F741D035047F9DD2BBF08209C140F6526F6F3690C90057495D1A21E072676CC7AA37A1FCD89B89F246199964863C14E50E8C67B925D1E855956532DE49EFCDDF03297B7D2CBCD1CB4331D0460FA34D8068AEA2A424E821685C4D0652CA4CF3EAB8ABEF2556509436E788FEDBEB36AA607187B9FCDA877AD2D2DD4F548DA7B2FEFB8D9B0A93EC4E647154E2F580C265A94B26D67163A7726461F1AAC7E3FA931DE5440B8BD3D9C3113108A0CF7249C4DBDAE9F5353F08C03D2E7F4F2C41F3B9E642D2F25E02CA40371BC03948DCB4F545FC48996A29A981C9A3F06A6C035FA550F71930D6D8616AFBD16AB116B61F527229462C0E2C85A8B3355CDCA41D3834F128FDF83E66CF451B53849B92E62B1D585B9887803CD199DA2DB477D1FE7344DEC32E7846AAD67D8EE061ED5D03820110F06850EF45710A8CBFEFE4F37238FA7B2E2E8878E59E3880359A44D3F582BF461095891872A7C609607181E762D261F77BF00714541334AFC99E9496B4F88E3A35B165AA17931353541E496897AD716628BDA56D82445871453B4F965F25DC30127E624976C34E40DB2280493208636C50384762674727B1239D9B1062BDD46ABC1AB4AB9876DF16CD475E87A17D6AB4C7C2F26066C10CA1281A7F5C81DF5696AB578D5AF6DF4B2F1049EE393A6AE58FEF0E96C4371AA7BBC73CA0A11C0E445195B259F212FD707E983E5C43231DA205C45C8658C93191A1566576ECD70F9A1CF2B19816F0E17E3DEB391EE79E5E5E5D6FDF29DE4654566543E40C82A668816E6BC2BB188B903361015DC27CD1D3CBEF04B75B9B6E25BCD1ECF7A92030D4491965B3971241FB3818F9187DEF6175D7B6F6AB06D272406D4613304D6A49887C1073079FAF3355C38DCA346D24B2D291AF8C13F6A08BD103F3BAB759A3793BF9EB53CD8356C3698F4DF13470E18155E4D71ED98FC942552A6042177F380650C421AB26160D7649467878DCE356EC40ABBE05548DFC85EF66991FAC63D2B7562BE644E92A9CADBAE559CA85E178DD172BFEEA8B6C92EDB257D52BAFA2F1DCD9D45D4EECA768F8DD44DACEA5FC98DF883D20DABAA0F1E9BF27434BAC3DCB7A9DCC5852BC5A7D4F658E1E48A9BC4BA7807B6120E258ABBEEA409243BFF242440FD5C01789FA496D6EE938D04FA77B8ACFC702A0D875D0220577AF6BC02097AE2F3F2A6B27B9ACBC56874B0717312B51AF1986FB56C49549F6EB81D6BD9BD104D782E4DFACC6E55FDFB131525EC00B910D994697DFC54B1B4A7B75143A390ABBE9DE250276AF6460028B24BAFB892BB4AD87B008CCED82C1CAF261269F6203E4761ED9B38224E916353668230B326D1CC4B292A3AC924FE2001F173B39DC46B6DB272E054128874DA714A608C17FFB656F50B8B6F7674A2BCEE3AC67ABB66C06D5F64747495C2DE79851D79B30CCB982BA1DFCA2217BF49167DD3079ED14E66A4F8BB6D79FAA7A5792A0F7CB304E576125B1E39C0E2A87391F5980EADC2CB5953466D4CD274BD15D3FD0C60011EC276FED82A4300662F078F8B627D77D6CDD89CBC8039A43935DBDFDEA46930191B9955EC9C9F8AE439DE021F19405B82B1564E062B187DDBBA631B40B22099358B49E2925725D7C5F5F2B122B5302A752ADC18B2F0D8C0100BFFF26EFFF546EE03CAFB3B5026BF73A2D8B57D9EF204E3CDAC70D11A83F4145CBF18BCCA0FD13DBC979C6D219457661D1DCBA5D72CC58D41DF7DD095472E99E4455A17456D7082148308486B8D89BAF4D42595C544C66EA5854E176B0E1A5C4A04CB55226CAEBE893621F98CD2382F9FB464B3F2C81E59AAFA779895FBB8D3FC03700967C49A96E0C6B8C0198EC69DE0538F4C5B684020061B3550D4E539CF4A5044E7D6156B3B5A5379C270AA47555C0B5B0268E441AF0FA7650D0219DD3AB1B797D82CE78F683342ED4CED29C1B5CF3C5FCEB2EA813551799C18E800FE943E3FFE23859C911B49E8BDC83614B69C367AD6528BB0DDE7269AEED2BC4B84D28D7767C5689E272397DAA2AA0199F0CD6DB8B6FFFFB1D1522A3D9AC4D089BF395AB90C8BE60D4E94C4725237DC53C59172DD19F52186626A2FABD8C37E5D910B2DB15ACF1F33E8FB54CD7C1A037E82A90C4AEF37304E232E64647436CB044DC40DFE0250A67C1112C180A67EB447CDF6FA3B6952DA4BC9D45D03A10906D7D2F911FD631A1E100BE68A3C08A0F71DE308BF8129721AD68C0ED4B631EDB8EC0CDD5A2A031CB5FFDA0D7EC0D228137AC59B1E85B053DAA404703F1031F7E5CEB072242C8094874F2FCE5460D9D14E6AE27025FCCA31B52E46355F694E838353DD802C3AB55B2F4B9BF610CC2702B6C62EC85BD5CD789305E687DA899DB239BE174CDE351B4280A49C7028C818122C45E15C3611C3DD313216E24C7050FFECE11785F5FF5D7C9302D13CB26A9D0DBD6F382D1473C3EEB9E40DD6DE03F68705ACE29DBDD4CF89DE1FAA5EB1D8472DE8FD1EDF50D6A25D141D1A8348278616CB759C66F3257EB973EC1C4171D0B4714D05703E065C7BDF03909532238A52ADC402056263420BF8DF889D53A02078C721B237692DC76394276B0FC6ADF5DD195748CD61695531CF400E87C23928CE656B12714A91D6A10F72CF0AA435A667129F6CEC50AA1142F0C84401AC5D9B87BF085C159A13512ACB6D36AC18EBCF44F1E8CCC1D0F87BBE8809B559A369F4F30B67A382DDC5353354C87A1CBB739D74B37133DFA63C44E6B99D9F5FB8F94CB7AA272C5433CDFF20E5C4469E932E5B2D9AAA70E89E0F70197B00C786CB718B1EEB858B7EAE71C6B449F4B7329662652A4A7D21087
))
GO*/

CREATE PROCEDURE [dv_list]

@boardid int=1,
@pagenow int=1,  --当前页数            
@pagesize int=1, --定义每页面帖子数目
@tl int=0,  --按时间段查询
@topicmode int=0, --专题
@totalrec int output

with encryption
 AS
set nocount on
declare @int_topnum int
declare @int_timenum int
declare @var_times varchar(5000)

if @pagenow>1
 if @topicmode>0
 begin
 select @int_timenum=(@pagenow-1)*@pagesize
 set rowcount @int_timenum
 select @var_times=lastposttime from Dv_Topic where boardID=@boardID and istop = 0 and mode=@topicmode ORDER BY lastposttime desc

 set rowcount @pagesize
 select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic from dv_topic where boardID=@boardID and istop = 0 and mode=@topicmode and lastposttime < @var_times ORDER BY lastposttime desc

 set nocount off
 return
 end
 else
 begin
 select @int_timenum=(@pagenow-1)*@pagesize
 set rowcount @int_timenum
 select @var_times=lastposttime from Dv_Topic where boardID=@boardID and istop = 0 ORDER BY lastposttime desc

 set rowcount @pagesize
 select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic from dv_topic where boardID=@boardID and istop = 0 and lastposttime < @var_times ORDER BY lastposttime desc

 set nocount off
 return
 end

else
 if @topicmode>0
 begin
 set rowcount @pagesize
 select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic from Dv_topic where boardID=@boardid and istop = 0 and mode=@topicmode ORDER BY lastposttime desc
 end
 else
 begin
 set rowcount @pagesize
 select TopicID,boardid,title,postusername,postuserid,dateandtime,child,hits,votetotal,lastpost,lastposttime,istop,isvote,isbest,locktopic,Expression,TopicMode,Mode,GetMoney,GetMoneyType,UseTools,IsSmsTopic from Dv_topic where boardID=@boardid and istop = 0 ORDER BY lastposttime desc
 end

GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  OFF
GO

exec(decrypt(0x05DFAFE2A33A32060660F7F6695C73CD5DE651D1CA7E4C6BDAB0904C423C5CC1AD8D73E01CA3A221B15829862D608421B3C5C61D1C71C28C73DB6119F5C2176CB7A903DF9F4F10C8A2D2CF55B9F931D96CB2CD3CB156ACEB9425AAEC80DE178A07124C02D2E74CEA4889A00420373A200E7B2F2A74AE96E155546DE2D73AE309128766ADCD5EB3F73D85E5BFAE3E406A29D7468507D7D45290CE2F63F038CE7CAA21C419302A9F8F087F483A1D94
))
GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  ON    SET ANSI_NULLS  OFF
GO

exec(decrypt(0x05DFAFE2EA011E81392C2B19947BAB3E551FDF43F7F776F2380A961752BB7EEF30D9A0C7EFEC32F883F24E62D5FDDE14A93900B22579CF4E3ECD2339E211DD19B5A64085290FFAAD7002C6CE8251AD57C175C228C385FE414BD875150BEBC731320E94D31F95CD50B728D9F9958119A2A558E7C16AE4B1346E6339E1B5EE92EE82643455E2AE99D022A2868873D5CFB246F3B0165EF456557AC10F06C0479E9FF157B93797C54A33CEE2E6D25846BA266E4E49C7BE6C6E138020E3D7FEB396C739A3B6A360F3A5BE00A14F1813375F9841A8A98D4037FE891DA1A4DCDF338404B1E7E890E2D06134109EDD5633D361E80F4D29B8377EADCCFEB07D2DD69773E2328F73B26555121ED862AA72F95F11015F8C6BA8B2C5D802E7D1D5FD7544D00AA1037180C1E64040EDD27CD305E513D94A3FBEADCD849D34521D1B4923928937DCB0612E94A1077C2F0654ECE4ABFDD1B4C4E5E054624B9703B8EBF4C3F28531A18AD59EB3476282CD6206C9CF57BCFDA95058780B12F81AAD89DF3AD92D90415650D8E1F0F71C93448264BBDA0BAD280A1A2B5C008979EC67DF9154900F975D7CC5DEAD17AE921B2022640DC2FD196200866EF7C7D832BBE3C8682E333FE8065DAA9EA14EF1A3FAC4BD71994D8F37322E5CF4E6A6DF5D59EF2874D5897029914EE8D45662596FEE3881499646EA556DDD74AE0B501EAE0F57909F887FFC5851CD661C45112BFF2D5AA72274C090B538029BCD04B0F78451EF47938FAE6D1F252131FC2E9F9BB72A29484808C2F465C4CB447C5C6BB31CDF7E16ACA1020F16FE86EA977C307CCB6AED493FD68C8B8270BBBF65910F3D180036542FE4DD00D4DD329138C50A5AAA15398F9FAAA39EAC785E321C44B55B36EF7444ED6CF35EF14D2D78EA9666E4BBB3A3401FAB792DC8549D8CE26E260AE4F77FAF68557579093719D213BBCA5AE161D020E3E42E14771DBE4CBF5EC8ED6BE6CBE7A7733D0D72007BFDD5FD36151B3722EBB05B8DF3C33DB7DD2C5B102ACAA05A1E1B0700958C20C653FCCDC1319C0C27A9A5A051EAA0658E38E9D6F6EC55CEE6EF497A78DEE4E702227C24CF3E801EC8432C052CD0A097F55CA7AA5829CAEE82AD5971D818571282A53D66F00A9C99F794FA2ACD9E36EE9A2633A42A4EE2AC38183CE0C17C7F3B1F53C337D8882099236E03582E1AA2727A531C777CF5B6ACF279737D474088B4EB22B9FB5383FFC3B7B0EF05200D57A226D9FA3D419A3B1BB024FEEF2BAE84FF184666865237AAD6642ED6A434EC58F2DBC9A938B4A0794925511956378479B5F48A6BCFFB992AA893A6FA8A8FC0A0436CCD2A9F15D3ACCBC8FDE868A42D4E2022B71015BD95628CDC6BF27A93511406B246EA3E55EACFDB5143B5D896A24403071BC1F1D1565EB63D06167118E9E8F45AE4BD1D1214E0338272E9D7C2034C925F6FFAA2DDCBE69995FF987EEFEE50FABC92D9E7B82EC54C64608073F2E993B749DFDE04247AC400E3C580899AF568FAA0CB0F3BB2934988D5A3D31F9DDEE6526BECD784D5C874F0439105F6D23C5EA94A50281AF7545B3EF4469BD4D92BAB57F20A7256D83F8C803ED3F581D3B011C64533AA7E3724946176C2420505A0299FF25C5EB56E7B590F74A537A399AC5CC9340D5E7CE4B52C52BDCF57CEC280C07ECF755A173D09A767BA23BC92C3ABAB34018CD85C733B45AF893E087476E4D6C6F7664E0E906A6AE4FF55D1AA8FB56A6BAF125EB637B2891E8177BDC662F041C0D3825A66E94826B18A3A40CD099B8D10883AD5481D7E8D1818CE3155D256385A14B8A292EB89EB2D96785DE009B11CF5A60F9904B27B80573DFD9CCF840D0681EA2C84A9722E341946A8146ADDC981499854079305FF87CD17827F7C08627E7D1C9B0B19413EE322D80FB416AECDD13FF85716FB51D2E891F74495B33FAA09EAAFC563BB33736681DB58632BF61EDC76AE1FBAAA9F958739975DC73CA204EF114BC4563E217AF7B78DAC9B08487CAA8359270D3BD8AF68D116F0FAF68D4F0D4E9A94689D90C98908D97BC6B4F01BE03F4259030D4F147703D1D94D7350E5826397B198D560F54C2B41A4AE8A12E4C7D1B08763E5D44CBF34B87D8882F5492CA02F30D1E56C518644C6A0134CF05C69828A363E7AC4B4884A560B612EDAFCB74CB8FE3B6DD960B7C0D4468AB07CF08E0EFAA6A42E4F1ECCF96A3FBBF691480D8366F7FFB87671E23B904880B4D7733B5F5BDEDF89DE39AE290BE2A2F4467495AE273598CA711B753DB695181035129AB472423364A775374831710FCC48C0E591D41CEEFAFB5D9D06B234145C40B2105ABC90143CEA6AA46DDFC7DFD063F67226111653E9595FBA3B4FF6619B44336357BABF604982F433866ECC497C2D70BDDA286FF352BA218440595D5E06BD3E89B4FFECEFCC093F01659695FCC11C02416CDB88F336D7F33697877D3223498A7C72AF5129630B28318BF397B2702F6BF6C98C14580FFE51DE6BF345B02E75A49CEBD0675B62759F6B4E145F74770DD04E777D2336F0F642E0B6AC978ED1A40706D7C8D4E5672346E67E91ABB79806E41ABF818C98C7C8A9AD57C86C513AE8079BD8CAFBE0CC0247B133101F19D40C9E28591EAD946DC3F6DF9B081C3DDE6782E9A41AC23C592F83955F1C263731044E2EB3D0A36CE7646007E2AE4866174F402C2DCC93F4CB8FD79F22A77160664A04CEB92ACD84892721428EB03616603429D031241A4BCFB5AF1808521D411A91BD95034155061DA5BD06319D483D69A7A38F6A8ADE97B809A28B78522EA453266A8D98D6772CDF65748B34DF033571D1357397F95D10D47F63EBDB216F9BD06EC37E49766A08680C332E11B286BB02C1DB3CE855888989C7FEA287758DA72EF8EFD838601C5A8652B0814D338AA4455C2090E4E1C6D96E160648F2179395F42C7CD9AA433C64E88EE0707C507528B948F45BA7EEE2C7176A9CC1B241DB4421C12A54BB03D5D9C8224ED6C2253AD9BCF09A5EC8961A00070B1630EBFDF2A124DA2BF04BC5A4B462C5F8860BD2244E5BFE27801EDD45B4F8A0F4BD57694E4BCB1425E65E4BB4E54A40F55B78DC89ADC49AE32FF98B51B17686EB2DBBB2C144E14FACDD72D27262C8B0436B32C79D3A214E87D0F08913A256E05F
))
GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO

SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  OFF
GO

exec(decrypt(0x05DFAFE2CFEB612D27068F4678A6CF8BD2046DC11CF8896F31FA1CD6D114421A50FB05B7A8B035F532B992F6F41A6C149290C50D8A604BC34FAE736C7462775A169025BBBC7207C19C78382DF3CFAB7DBE97E96F92493D99F0E384EC09F1917AB016EC63E98A5FC2D63491D61F0DA91702BCAC3921D43A69C534F4AADAC320FE961121E58262A36909BDDA4A28A5F4B881E1F0D80D37C62D60736490356FDD564109886C5359E1846D4997EFDF23742DC9B4C8BCB3949DE6A6D3210AFBE94817527191733E788D35C97CBFB99C9B6BC3859FEC70B9283377526C886D9836F96ECCF2D14C6B102404F4A4EEBD9E8187E66835E475EF7408205C09ED4FF2B73A3E0254C0AD638E021CF58DBC9B9A4CC232F9700699667CFEDDD093AC9CF08FCB85BF867E251F80F71871A88BF794F92C602BC1D3AA01FF4F17EE40367C80CBA38744AC9395D4C39714E28967A19B43FC745BD141D6A96198F33E3D081E58A426CF44276DBE7F72361795A5167C
))
GO
SET QUOTED_IDENTIFIER  OFF    SET ANSI_NULLS  ON
GO


--sp1更新
alter table Dv_ChallengeInfo add D_icpNO nvarchar(50)

alter table Dv_ChallengeInfo add D_web_intro ntext

alter table Dv_User add UserAvaSetting ntext
alter table Dv_user add UserIsAva tinyint


--Dv_topic [HideName]
if not exists(select * from syscolumns where id =object_id('Dv_topic')
and name ='HideName')
alter table dv_topic add HideName tinyint Not Null default 0

相关文章推荐

动网论坛 v7.1.0 SP1 SQL版

  • 2006年01月13日 10:19
  • 3.47MB
  • 下载

【数据库】【SQL Server 2016 SP1】安装记录

下载链接:https://www.microsoft.com/en-us/sql-server/sql-server-downloads 双击>>>> 出现新窗口,我选的是自定义安装,根...

动网论坛 v7.1.0 SP1 SQL储存过程版

  • 2005年12月27日 09:38
  • 3.29MB
  • 下载

Upgrade Microsoft Visual Studio 2008 to the SP1 before installing SQL Server 2008.

A previous release of Microsoft Visual Studio 2008 is installed on this computer. Upgrade Microsoft ...

动网论坛 v7.1.0 SP1 SQL版

  • 2007年08月31日 09:55
  • 3.47MB
  • 下载

边缘Dvbbs v7.1 SP1 SQL存储过程增强版

  • 2006年04月05日 10:37
  • 3.78MB
  • 下载

安装VS2010 SP1后SQL Server 2008 r2智能感知功能(IntelliSense)失效!

记得有人提到过,在安装Vs2010 Sp1后,SQL server 2008 r2的智能感知功能失效。今天试了一下,发现确实如此。...

源码基地论坛DV v7.1.0 sp1美化版

  • 2006年02月22日 10:30
  • 3.37MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:dvbbs7.1.0 SP1的SQL版的数据库建库脚本
举报原因:
原因补充:

(最多只允许输入30个字)