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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [tab_CJ] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[FS] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[KM] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_GZCX] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[xb] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zGZ] [int] NULL ,
	[NF] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_IMAGE] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG1] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG2] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG3] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG4] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG6] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG7] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG8] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG9] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG10] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[IMG5] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_News] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsDel] [tinyint] NULL ,
	[IsEssence] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (550) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_diary] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[weather] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[mood] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[newDate] [datetime] NULL ,
	[myAddress] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[add] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[N] [numeric](18, 3) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_shop] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[price] [numeric](18, 3) NULL ,
	[unit] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[area] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[brand] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_soft] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[t1] [datetime] NULL ,
	[ver] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[OS] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[KFGJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZCRY] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[WJDX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_softdown] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsDel] [tinyint] NULL ,
	[IsEssence] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[down1] [nvarchar] (213) COLLATE Chinese_PRC_CI_AS NULL ,
	[down2] [nvarchar] (213) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[fileSize] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[runOS] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zz] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zzUrl] [nvarchar] (212) COLLATE Chinese_PRC_CI_AS NULL ,
	[demoUrl] [nvarchar] (212) COLLATE Chinese_PRC_CI_AS NULL ,
	[up_Date] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_video] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[BFDZ] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[PC] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[JYJS] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[DY] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SIZE] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[WVM] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[RM] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_Address] (
	[lb2] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[lb2id] [int] NULL ,
	[lb1] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_BBSMain] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveDate] [datetime] NULL ,
	[saveUserID] [int] NULL ,
	[reID] [int] NULL ,
	[reUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[reDate] [datetime] NULL ,
	[reUserID] [int] NULL ,
	[vote] [int] NULL ,
	[isTop] [tinyint] NULL ,
	[isElite] [tinyint] NULL ,
	[locked] [tinyint] NULL ,
	[prefix] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[reCount] [int] NULL ,
	[clickCount] [int] NULL ,
	[outInt] [int] NULL ,
	[inInt] [int] NULL ,
	[isReDisplay] [tinyint] NULL ,
	[reUserIDList] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[titleIco] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[saveAddress] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[postType] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_BBSRe] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[mainID] [int] NULL ,
	[saveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUserID] [int] NULL ,
	[saveDate] [datetime] NULL ,
	[saveIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveAddress] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[intInt] [int] NULL ,
	[layerInt] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_Config] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[value] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[type] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[explain] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[userName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[cid] [int] NULL ,
	[isSys] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_ConfigUser] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[fieldName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fieldAsName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isFind] [tinyint] NULL ,
	[isNull] [tinyint] NULL ,
	[editMode] [int] NULL ,
	[isRow] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Config_Field] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[TID] [int] NULL ,
	[IndexNum] [int] NULL ,
	[fName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fAsName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fType] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[fSize] [int] NULL ,
	[fEditType] [int] NULL ,
	[fOrder] [tinyint] NULL ,
	[isNull] [tinyint] NULL ,
	[isFind] [tinyint] NULL ,
	[isEdit] [tinyint] NULL ,
	[isList] [tinyint] NULL ,
	[isWindow] [tinyint] NULL ,
	[isSys] [tinyint] NULL ,
	[postfix] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[power] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Config_Input] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[inField] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[outField] [nvarchar] (60) COLLATE Chinese_PRC_CI_AS NULL ,
	[iniName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[type] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Config_MenuInt] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[IsDefault] [tinyint] NULL ,
	[MIName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Art_Add_Int] [int] NULL ,
	[art_Add_Money] [int] NULL ,
	[Art_View_Int] [int] NULL ,
	[Art_View_Money] [int] NULL ,
	[Cmt_Add_Int] [int] NULL ,
	[Cmt_add_Money] [int] NULL ,
	[Art_Ese_Int] [int] NULL ,
	[Art_Top_Int] [int] NULL ,
	[Art_Del_Int] [int] NULL ,
	[Cmt_Del_Int] [int] NULL ,
	[Art_Non_Int] [int] NULL ,
	[Groupid] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Config_MenuPower] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[MPType] [tinyint] NULL ,
	[IsDefault] [tinyint] NULL ,
	[MPName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IndexNum] [int] NULL ,
	[IsSafeMenu] [tinyint] NULL ,
	[P_A_View_G] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_View_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Add_G] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Add_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Edit_G] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Edit_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Area] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_AreaType] [tinyint] NULL ,
	[P_A_manage] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_IsExamine] [tinyint] NULL ,
	[P_A_IsPower] [tinyint] NULL ,
	[P_A_Examine_1] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Examine_2] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Examine_3] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Examine_4] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_IsExamine] [tinyint] NULL ,
	[P_C_View_G] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_View_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_Add_G] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_Add_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_manage] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Config_Tab] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[tabName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[tabAsName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DisplayType] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ContentPage] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EditPage] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PageSize] [int] NULL ,
	[isSys] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Count] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[jNum] [int] NULL ,
	[zNum] [int] NULL ,
	[ipNum] [int] NULL ,
	[jIpNum] [int] NULL ,
	[jClick] [int] NULL ,
	[zClick] [int] NULL ,
	[countDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Count_DayIP] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ipDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Count_DayJsIP] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ipDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Desktop] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[pName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[X] [int] NULL ,
	[Y] [int] NULL ,
	[userID] [int] NULL ,
	[userName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_FindKey] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[findKey] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[findCount] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Grade] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[GradeName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Point_down] [int] NULL ,
	[Point_up] [int] NULL ,
	[Image] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_LabelClass] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[ClassName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ClassType] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileName] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Program] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Log] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[LogType] [int] NOT NULL ,
	[LogDate] [datetime] NOT NULL ,
	[LogBody] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[LogIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[LogUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[LogPage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[LogSpage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Menu] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[MID] [int] NULL ,
	[MName] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[IndexNum] [int] NULL ,
	[UpListID] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[layer] [int] NULL ,
	[isDown] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[mDate] [datetime] NULL ,
	[DownListID] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[menuType] [tinyint] NULL ,
	[UsePower] [int] NULL ,
	[UserInt] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Intro] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PageSize] [int] NULL ,
	[IsPageUrl] [tinyint] NULL ,
	[PageUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[AsTab] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TitleImg] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuText] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[Affiche] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuKey] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[isNavigation] [tinyint] NULL ,
	[isMenu] [tinyint] NULL ,
	[isHidden] [tinyint] NULL ,
	[isReview] [tinyint] NULL ,
	[isHTML] [tinyint] NULL ,
	[templet] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[isListFile] [tinyint] NULL ,
	[isHomePage] [tinyint] NULL ,
	[bbsNewCount] [int] NULL ,
	[bbsNewTitle] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[bbsNewDate] [datetime] NULL ,
	[bbsNewID] [int] NULL ,
	[bbsNewUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[bbsTitleCount] [int] NULL ,
	[bbsReCount] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_Msg] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[savedate] [datetime] NULL ,
	[fromUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[toUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isShow] [tinyint] NULL ,
	[isAnnex] [tinyint] NULL ,
	[annexURL] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[fromDel] [tinyint] NULL ,
	[toDel] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_Program] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[pName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isPop] [tinyint] NULL ,
	[pAsName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[windowType] [int] NULL ,
	[upWindow] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Width] [int] NULL ,
	[Height] [int] NULL ,
	[ICO] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Path] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[MID] [int] NULL ,
	[isSys] [tinyint] NULL ,
	[isDeskTop] [tinyint] NULL ,
	[runCount] [int] NULL ,
	[runDate] [datetime] NULL ,
	[mUser] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Source] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[SeekKey] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceWeb] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Syear] [char] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
	[Smonth] [int] NOT NULL ,
	[Sday] [int] NOT NULL ,
	[Stotal] [int] NOT NULL ,
	[Cdate] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Tab_Base] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[Count_Click] [int] NULL ,
	[Count_Down] [int] NULL ,
	[Count_Revert] [int] NULL ,
	[Point_Good] [int] NULL ,
	[Point_Bad] [int] NULL ,
	[Examine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[IsEssence] [tinyint] NULL ,
	[isDel] [tinyint] NULL ,
	[IsTop] [int] NULL ,
	[IsRemark] [tinyint] NULL ,
	[IsHidden] [tinyint] NULL ,
	[Art_View_Int_ID] [int] NULL ,
	[P_A_View_ID] [int] NULL ,
	[WebUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[signFor] [tinyint] NULL ,
	[signForUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[signInUser] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upfile] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_UpFile] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[SourceName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FilePath] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[FileType] [int] NULL ,
	[UpDateTime] [datetime] NULL ,
	[UpUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UpUserID] [int] NULL ,
	[FileSize] [int] NULL ,
	[sExName] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[nExName] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[userCount] [int] NULL ,
	[uIP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_UserGroup] (
	[ID] [int] IDENTITY (1000000, 1) NOT NULL ,
	[GroupName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsDefault] [tinyint] NULL ,
	[IsGuest] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_User_Base] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PassWord] [nvarchar] (32) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsLocked] [tinyint] NULL ,
	[RegDate] [datetime] NULL ,
	[Count_Login] [int] NULL ,
	[Date_Login] [datetime] NULL ,
	[Last_IP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsExamine] [tinyint] NULL ,
	[ExamineUserName] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[ExamineUserID] [int] NULL ,
	[EffectDate] [smalldatetime] NULL ,
	[Count_Release] [int] NULL ,
	[Count_Comment] [int] NULL ,
	[Delete_Release] [int] NULL ,
	[Delete_Comment] [int] NULL ,
	[Integral_Base] [int] NULL ,
	[Integral_Expert] [int] NULL ,
	[Integral_Total] [int] NULL ,
	[LevelID] [int] NULL ,
	[LevelName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Money] [int] NULL ,
	[GroupID] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[GroupName] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[ActionCode] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[ActionDate] [datetime] NULL ,
	[AvailDate] [datetime] NULL ,
	[Email] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[PasQuestion] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[PasAnswer] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Mobile] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[idiograph] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[isAdmin] [tinyint] NULL ,
	[userPhoto] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_User_extend] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[UID] [int] NULL ,
	[F_sex] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_year] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_name] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_duty] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_QQ] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_homePage] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_tel] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_homeAdd] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_post] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_Co] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_Coadd] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_Cotel] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_Coboss] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[F_Copage] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_area] (
	[addname] [nvarchar] (3) COLLATE Chinese_PRC_CI_AS NULL ,
	[num] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_contribute] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[mid] [int] NULL ,
	[mName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[uID] [int] NULL ,
	[uName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[uGroup] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[uGroupID] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Examine] [tinyint] NULL ,
	[tabName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[tabid] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_ip] (
	[startip] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
	[endip] [nvarchar] (16) COLLATE Chinese_PRC_CI_AS NULL ,
	[country] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[startint] [numeric](10, 0) NULL ,
	[endint] [numeric](10, 0) NULL ,
	[left2] [nvarchar] (2) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_optionList] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[SName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[mainItemText] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[mainItemValue] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[downItem] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[sIndex] [int] NULL ,
	[isSys] [tinyint] NULL ,
	[itemType] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_review] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[ATab] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[AID] [int] NULL ,
	[MID] [int] NULL ,
	[IsExamine] [tinyint] NULL ,
	[SaveUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (15) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveDate] [datetime] NULL ,
	[SaveAddress] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[IsHide] [bit] NULL ,
	[Title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Comment] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[good] [int] NULL ,
	[bad] [int] NULL ,
	[review] [int] NULL ,
	[LevelCount] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_room] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[mid] [int] NULL ,
	[tabid] [int] NULL ,
	[tabname] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[isDel] [bit] NULL ,
	[delDate] [datetime] NULL ,
	[title] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[cbs] [nvarchar] (550) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUser] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[createDate] [datetime] NULL ,
	[isHtml] [bit] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_signFor] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[tabid] [int] NULL ,
	[tab] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[mid] [int] NULL ,
	[toUser] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[state] [tinyint] NULL ,
	[toDate] [datetime] NULL ,
	[signForDate] [datetime] NULL ,
	[endDate] [datetime] NULL ,
	[fileTitle] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
	[leaveWord] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_userLevel] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[LevelName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[minInt] [int] NULL ,
	[groupid] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_vot] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[optionName] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[countNum] [nvarchar] (1000) COLLATE Chinese_PRC_CI_AS NULL ,
	[type] [tinyint] NULL ,
	[isV] [tinyint] NULL ,
	[endDate] [int] NULL ,
	[uList] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[createDate] [datetime] NULL ,
	[isBBS] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_web] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[sTime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[inCount] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[eTime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isEnd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isWeb] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[tTime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[webip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[adCode] [nvarchar] (2000) COLLATE Chinese_PRC_CI_AS NULL ,
	[webCode] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [tab_CJ] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_CJ] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [tab_IMAGE] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_IMAGE] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_News] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_news] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_diary] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_diary] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_shop] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_shop] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_soft] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_soft] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_softdown] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_softdown] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [tab_video] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_video] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Address] WITH NOCHECK ADD 
	CONSTRAINT [PK_zAddress] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

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

ALTER TABLE [zydn_Config] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Config] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_ConfigUser] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_ConfigUser] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Config_Field] WITH NOCHECK ADD 
	CONSTRAINT [PK_] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Config_MenuInt] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Config_MenuInt] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Config_MenuPower] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Config_MenuPower] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Config_Tab] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Config_Tab] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Count_DayIP] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Count_DayIP] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Count_DayJsIP] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Count_DayJsIP] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Desktop] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Desktop] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Grade] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Grade] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Log] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Log] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Menu] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Menu] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Program] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Program] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Source] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Source] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Tab_Base] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Tab_Base] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_UpFile] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_UpFile] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_UserGroup] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_UserGroup] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_User_Base] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_User_Base] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_User_extend] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_User_extend] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_area] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_add] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_ip] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_ip] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_optionList] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_DropDownList] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [zydn_review] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Comment] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

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

ALTER TABLE [zydn_userLevel] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_userLevel] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

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

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

ALTER TABLE [tab_News] WITH NOCHECK ADD 
	CONSTRAINT [DF_tab_News_IsRemark] DEFAULT (0) FOR [IsRemark]
GO

ALTER TABLE [tab_softdown] WITH NOCHECK ADD 
	CONSTRAINT [DF_tab_softdown_IsRemark] DEFAULT (0) FOR [IsRemark]
GO

ALTER TABLE [zydn_BBSMain] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_BBSMain_vote] DEFAULT (0) FOR [vote],
	CONSTRAINT [DF_zydn_BBSMain_isTop] DEFAULT (0) FOR [isTop],
	CONSTRAINT [DF_zydn_BBSMain_isElite] DEFAULT (0) FOR [isElite]
GO

ALTER TABLE [zydn_BBSRe] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_BBSRe_layerInt] DEFAULT (0) FOR [layerInt]
GO

ALTER TABLE [zydn_Config_Field] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Config_Field_isSys] DEFAULT (0) FOR [isSys]
GO

ALTER TABLE [zydn_Config_Tab] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Config_Tab_isSys] DEFAULT (0) FOR [isSys]
GO

ALTER TABLE [zydn_Count] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Count_jNum] DEFAULT (0) FOR [jNum],
	CONSTRAINT [DF_zydn_Count_zNum] DEFAULT (0) FOR [zNum],
	CONSTRAINT [DF_zydn_Count_ipNum] DEFAULT (0) FOR [ipNum],
	CONSTRAINT [DF_zydn_Count_jIpNum] DEFAULT (0) FOR [jIpNum],
	CONSTRAINT [DF_zydn_Count_jClick] DEFAULT (0) FOR [jClick],
	CONSTRAINT [DF_zydn_Count_zClick] DEFAULT (0) FOR [zClick]
GO

ALTER TABLE [zydn_Menu] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Menu_layer] DEFAULT (0) FOR [layer],
	CONSTRAINT [DF_zydn_Menu_isDown] DEFAULT (0) FOR [isDown],
	CONSTRAINT [DF_zydn_Menu_isDel] DEFAULT (0) FOR [isDel],
	CONSTRAINT [DF_zydn_Menu_mDate] DEFAULT (getdate()) FOR [mDate],
	CONSTRAINT [DF_zydn_Menu_bbsIsNew] DEFAULT (0) FOR [bbsNewCount],
	CONSTRAINT [DF_zydn_Menu_bbsNewID] DEFAULT (0) FOR [bbsNewID],
	CONSTRAINT [DF_zydn_Menu_bbsTitleCount] DEFAULT (0) FOR [bbsTitleCount],
	CONSTRAINT [DF_zydn_Menu_bbsReCount] DEFAULT (0) FOR [bbsReCount]
GO

ALTER TABLE [zydn_Msg] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Msg_isDel] DEFAULT (0) FOR [fromDel]
GO

ALTER TABLE [zydn_Program] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Program_isSys] DEFAULT (0) FOR [isSys],
	CONSTRAINT [DF_zydn_Program_runCount] DEFAULT (0) FOR [runCount]
GO

ALTER TABLE [zydn_Tab_Base] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_Tab_Base_Count_Click] DEFAULT (0) FOR [Count_Click],
	CONSTRAINT [DF_zydn_Tab_Base_Count_Down] DEFAULT (0) FOR [Count_Down],
	CONSTRAINT [DF_zydn_Tab_Base_Count_Revert] DEFAULT (0) FOR [Count_Revert],
	CONSTRAINT [DF_zydn_Tab_Base_Point_Good] DEFAULT (0) FOR [Point_Good],
	CONSTRAINT [DF_zydn_Tab_Base_Point_Bad] DEFAULT (0) FOR [Point_Bad],
	CONSTRAINT [DF_zydn_Tab_Base_Examine] DEFAULT (1) FOR [Examine],
	CONSTRAINT [DF_zydn_Tab_Base_SaveDate] DEFAULT (getdate()) FOR [SaveDate],
	CONSTRAINT [DF_zydn_Tab_Base_IsEssence] DEFAULT (0) FOR [IsEssence],
	CONSTRAINT [DF_zydn_Tab_Base_IsTop] DEFAULT (0) FOR [IsTop],
	CONSTRAINT [DF_zydn_Tab_Base_IsRemark] DEFAULT (0) FOR [IsRemark],
	CONSTRAINT [DF_zydn_Tab_Base_IsHidden] DEFAULT (0) FOR [IsHidden],
	CONSTRAINT [DF_zydn_Tab_Base_Art_View_Int_ID] DEFAULT ((-1)) FOR [Art_View_Int_ID],
	CONSTRAINT [DF_zydn_Tab_Base_P_A_View_ID] DEFAULT ((-1)) FOR [P_A_View_ID],
	CONSTRAINT [DF_zydn_Tab_Base_WebUrl] DEFAULT (0) FOR [WebUrl],
	CONSTRAINT [DF_zydn_Tab_Base_inquiry] DEFAULT ((-1)) FOR [inquiry]
GO

ALTER TABLE [zydn_UpFile] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_UpFile_UpDateTime] DEFAULT (getdate()) FOR [UpDateTime]
GO

ALTER TABLE [zydn_room] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_room_isDdel] DEFAULT (0) FOR [isDel],
	CONSTRAINT [DF_zydn_room_isHtml] DEFAULT (0) FOR [isHtml]
GO

ALTER TABLE [zydn_userLevel] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_userLevel_groupid] DEFAULT ((-1)) FOR [groupid]
GO

ALTER TABLE [zydn_vot] WITH NOCHECK ADD 
	CONSTRAINT [DF_zydn_investigate_optionName] DEFAULT (N'选项') FOR [optionName],
	CONSTRAINT [DF_zydn_vot_isBBS] DEFAULT (0) FOR [isBBS]
GO

 CREATE  INDEX [IX_tab_CJ] ON [tab_CJ]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_tab_GZCX] ON [tab_GZCX]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_IMAGE] ON [tab_IMAGE]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_News] ON [tab_News]([Count_Click], [Count_Down], [IsDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_diary] ON [tab_diary]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_shop] ON [tab_shop]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_soft] ON [tab_soft]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_softdown] ON [tab_softdown]([Count_Click], [Count_Down], [IsEssence], [IsDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_tab_video] ON [tab_video]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_BBSMain] ON [zydn_BBSMain]([isTop] DESC , [isElite], [clickCount], [reCount]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Config_Field] ON [zydn_Config_Field]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Config_MenuInt] ON [zydn_Config_MenuInt]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Config_Filed] ON [zydn_Config_MenuPower]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Config_Tab] ON [zydn_Config_Tab]([ID], [tabName]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Count] ON [zydn_Count]([countDate] DESC ) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Menu] ON [zydn_Menu]([UpListID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Menu_1] ON [zydn_Menu]([MID], [IndexNum], [MName]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Program] ON [zydn_Program]([pName]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Program_1] ON [zydn_Program]([runCount] DESC ) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Tab_Base] ON [zydn_Tab_Base]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_User_Base] ON [zydn_User_Base]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_ip] ON [zydn_ip]([startint], [endint]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_Comment] ON [zydn_review]([ID]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_zydn_room] ON [zydn_room]([mid], [tabid], [tabname]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addClick]
 AS
/*增加日访问统计,  总点击量*/

Declare  @isNew int 
Declare @newDate DateTime
set @newDate =convert(char(10),getDate(),120)

select   @isNew = count(*)   from [zydn_Count]  where countDate= @newDate

if @isNew=0  
	insert into [zydn_Count] 
	(
	zClick,
	countDate	
	) 
	values(
	1,
	@newDate
	)
else
	update [zydn_Count] set zClick=zClick+1 where countDate=@newDate

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addIpClick]
@IP varchar(50)=null
 AS
/*增加日访问统计,  IP流量*/

Declare  @isNew int 
Declare @newDate DateTime
/*Declare @isClear int */
Declare @MaxDate DateTime
set @newDate =convert(char(10),getDate(),120)
set @isNew=0
set @MaxDate=null

select top 1  @MaxDate=ipDate from [zydn_Count_DayIP] 
if (@MaxDate<>@newDate   )
	BEGIN
		delete  from  [zydn_Count_DayIP] 
		insert into   [zydn_Count_DayIP]   (ip,ipDate) values(@IP,@newDate)
		set @isNew=1
	END
else
	BEGIN
		select @isNew=count(1) from  [zydn_Count_DayIP]  where IP=@IP
		if (@isNew =0 )
			BEGIN
				insert into   [zydn_Count_DayIP]  (ip,ipDate) values(@IP,@newDate)
				set @isNew=1
			END
		else
			BEGIN
				set @isNew=0
			END
	END

if (@isNew=1)
	BEGIN
		select   @isNew = count(1)   from [zydn_Count]  where countDate=@newDate
		
		if @isNew=0  
			insert into [zydn_Count] (ipNum,countDate	) values(1,@newDate)
		else
			update [zydn_Count] set ipNum=ipNum+1 where countDate=@newDate
	END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addJsClick]
 AS
/*增加日访问统计,  JS点击量*/

Declare  @isNew int 
Declare @newDate DateTime
set @newDate =convert(char(10),getDate(),120)

select   @isNew = count(*)   from [zydn_Count]  where countDate=@newDate

if @isNew=0  
	insert into [zydn_Count] 
	(
	jClick,
	countDate	
	) 
	values(
	1,
	@newDate
	)
else
	update [zydn_Count] set jClick=jClick+1 where countDate=@newDate

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addJsIpClick]
@IP varchar(50)=null
 AS
/*增加日访问统计,  JS 检测的 IP流量*/

Declare  @isNew int 
Declare @newDate DateTime
/*Declare @isClear int */
Declare @MaxDate DateTime
set @newDate =convert(char(10),getDate(),120)
set @isNew=0
set @MaxDate=null

select top 1  @MaxDate=ipDate from [zydn_Count_DayJsIP] 
if (@MaxDate<>@newDate   )
	BEGIN
		delete  from  [zydn_Count_DayJsIP] 
		insert into   [zydn_Count_DayJsIP]   (ip,ipDate) values(@IP,@newDate)
		set @isNew=1
	END
else
	BEGIN
		select @isNew=count(1) from  [zydn_Count_DayJsIP]  where IP=@IP
		if (@isNew =0 )
			BEGIN
				insert into   [zydn_Count_DayJsIP]  (ip,ipDate) values(@IP,@newDate)
				set @isNew=1
			END
		else
			BEGIN
				set @isNew=0
			END
	END


if (@isNew=1)
	BEGIN
		select   @isNew = count(1)   from [zydn_Count]  where countDate=@newDate
		
		if @isNew=0  
			insert into [zydn_Count] (jIpNum,countDate	) values(1,@newDate)
		else
			update [zydn_Count] set jIpNum=jIpNum+1 where countDate=@newDate
	END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addJsNum]
 AS
/*增加日访问统计,  JS总流量*/

Declare  @isNew int 
Declare @newDate DateTime
set @newDate =convert(char(10),getDate(),120)

select   @isNew = count(*)   from [zydn_Count]  where countDate=@newDate

if @isNew=0  
	insert into [zydn_Count] 
	(
	jNum,
	countDate	
	) 
	values(
	1,
	@newDate
	)
else
	update [zydn_Count] set jNum=jNum+1 where countDate=@newDate

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_Count_addNum]
 AS
/*增加日访问统计,  总流量*/

Declare  @isNew int 
Declare @newDate DateTime
set @newDate =convert(char(10),getDate(),120)

select   @isNew = count(*)   from [zydn_Count]  where countDate= @newDate

if @isNew=0  
	insert into [zydn_Count] 
	(
	zNum,
	countDate	
	) 
	values(
	1,
	@newDate
	)
else
	update [zydn_Count] set zNum=zNum+1 where countDate=@newDate

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_CJ] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_CJ] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_CJ] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_CJ] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_GZCX] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_GZCX] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_GZCX] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_GZCX] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_IMAGE] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_IMAGE] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_IMAGE] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_IMAGE] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_News] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_News] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_News] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_News] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_diary] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_diary] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_diary] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_diary] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_shop] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_shop] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_shop] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_shop] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_soft] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_soft] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_soft] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_soft] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_softdown] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_softdown] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_softdown] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_softdown] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_video] 
 @title varchar (100) =null,
@content text =null  ,
 @saveUser varchar(50) =null  ,
 @saveUserID varchar(50) =null  ,
 @saveUserIP varchar(50) =null  ,
@IPaddress   varchar(200)=null, 
@CBS varchar(250) =null  ,
@Kind varchar(50) =null,
@TabKeys varchar(250) =null  ,
@TabImage varchar(250) =null  ,
@WebUrl varchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry varchar(100) =null  ,
@Source varchar(50) =null  ,
@SourceUrl varchar(250) =null  ,
@signFor int =null  ,
@signForUser varchar(250) =null  ,
@fid int =null,
@id int =null output 
 AS
/* 
修改条记录的基本数据
*/
if(@fid is null)   
    INSERT INTO [tab_video] ([title],[content],[SaveUser],[SaveUserID],[SaveUserIP],[IPaddress],[SaveDate],[CBS],[Kind],[TabKeys],[TabImage],[WebUrl],[IsTop],[IsEssence],[Examine],[IsHidden],[Count_Click],[Count_Down],[Count_Revert],[Point_Good],[Point_Bad],[Art_View_Int_ID],[P_A_View_ID],[inquiry],[Source],[SourceUrl],[signFor],[signForUser],[signInUser],[isDel],IsRemark)  values(@title,@content,@saveUser,@saveUserID,@saveUserIP,@IPaddress,getdate(),@CBS,@Kind,@TabKeys,@TabImage,@WebUrl,@IsTop,@IsEssence,@Examine,@IsHidden,0,0,0,0,0,@ArtID,@pID,@inquiry,@Source,@SourceUrl,@signFor,@signForUser,'',0,@IsRemark) 
 else  
  update [tab_video] set  title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=getDate(),cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[Art_View_Int_ID]=@ArtID,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   


 if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_video] order by id desc
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id=    @saveUserID
		
	END
else
	BEGIN
	 set @id=@fid
	END 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_FindKey]

@findKey  varchar(200) =null
 AS

Declare  @isUse  int 

select   @isUse= count(0) from zydn_FindKey where findKey=@findKey

if (@isUse=0)
	insert into [zydn_FindKey] (findKey,findCount) values(@findKey,1)
else
	update [zydn_findKey] set findCount=findCount+1 where findKey=@findKey

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_MoveMenu]
@inID int= null,
@outID int= null,
@menuid int =null
 AS

Declare @inUPID varchar(250)
Declare @newUPID  varchar(250)
Declare @inLayer int
Declare @newLayer int
Declare @Layer  int
Declare @isDown int
Declare @UpList varchar(250)


select  @inUPID= upListID, @inLayer =layer  from zydn_menu where mid=@inID

select @newUPID=upListID,@newLayer=layer from zydn_menu where mid =@outID

set @Layer=@newLayer-@inLayer+1

set @newUPID=@newUPID+","+CAST(@inID as varchar(50))

update zydn_menu set upListID=@newUPID,layer = layer+@Layer  where mid=@inID

upDate zydn_menu set upListID=replace(upListID,@inUPID,@newUPID) ,layer = layer+@Layer   where upListID like @inUPID+',%'

upDate zydn_menu set isDown=1  where mid=@outID

upDate zydn_menu set layer =0 where layer <0

select @UpList=upListID from zydn_menu where mid=@menuid

select @isDown=count(*) from zydn_menu where upListID like  @UpList+',%'
if (@isDown =0 )
	update zydn_menu set isDown=0 where mid=@menuid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_SaveOption]
@sindex int =null,
@name varchar(50)=null,
@text varchar(50)=null,
@value varchar(50)=null,
@downText varchar(1000)=null,
@sType int=null,
@isClear int =null,
@outindex int =null output
 AS

Declare @maxid int

if  (@isClear = 1 and @sindex is not null)
  delete from zydn_optionList where  sIndex=@sindex

if (@sindex is null)
	select top 1 @maxid= id+1  from zydn_optionList order by id desc
else
	set @maxid=@sindex

if (@maxid is null or @maxid=0)
set @maxid=1

 INSERT INTO [zydn_optionList] (SName,mainItemText,mainItemValue,downItem,sIndex,itemType,isSys) 
		values
		(@name,@text,@value,@downText,@maxid,@sType,0)
set @outindex=@maxid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_SavePower]
@MPName nvarchar(50) =null,
@MPType int =null,
@P_A_View_G nvarchar(200)=null,
@P_A_View_U nvarchar(500)=null,
@P_A_Add_G nvarchar(200)=null,
@P_A_Add_U nvarchar(500)=null,
@P_A_Edit_G nvarchar(200)=null,
@P_A_Edit_U nvarchar(500)=null,
@P_A_Area nvarchar(250)=null,
@P_A_AreaType int =null,
@P_A_manage nvarchar(200)=null,
@P_A_IsExamine int =null,
@P_A_IsPower int =null,
@P_A_Examine_1 nvarchar(200)=null,
@P_A_Examine_2 nvarchar(200)=null,
@P_A_Examine_3 nvarchar(200)=null,
@P_A_Examine_4 nvarchar(200)=null,
@P_C_IsExamine int= null,
@P_C_View_G nvarchar(200)=null,
@P_C_View_U nvarchar(500)=null,
@P_C_Add_G nvarchar(200)=null,
@P_C_Add_U nvarchar(500)=null,
@P_C_manage nvarchar(200)=null,
@IsDefault int =null,
@powerID int =null output

 AS
Declare @eof int
select   @eof=count(*)  from zydn_Config_MenuPower where MPName=@MPName and MPType=@MPType
if (@eof=0)
	INSERT INTO [zydn_Config_MenuPower]
	(
	MPName ,
	MPType ,
	P_A_View_G ,
	P_A_View_U,
	P_A_Add_G,
	P_A_Add_U,
	P_A_Edit_G ,
	P_A_Edit_U,
	P_A_Area ,
	P_A_AreaType ,
	P_A_manage ,
	P_A_IsExamine,
	P_A_IsPower  ,
	P_A_Examine_1 ,
	P_A_Examine_2 ,
	P_A_Examine_3,
	P_A_Examine_4 ,
	P_C_IsExamine ,
	P_C_View_G,
	P_C_View_U ,
	P_C_Add_G,
	P_C_Add_U,
	P_C_manage ,
	IsDefault
	 )
	VALUES(
	@MPName ,
	@MPType ,
	@P_A_View_G ,
	@P_A_View_U,
	@P_A_Add_G,
	@P_A_Add_U,
	@P_A_Edit_G ,
	@P_A_Edit_U,
	@P_A_Area ,
	@P_A_AreaType ,
	@P_A_manage ,
	@P_A_IsExamine,
	@P_A_IsPower  ,
	@P_A_Examine_1 ,
	@P_A_Examine_2 ,
	@P_A_Examine_3,
	@P_A_Examine_4 ,
	@P_C_IsExamine ,
	@P_C_View_G,
	@P_C_View_U ,
	@P_C_Add_G,
	@P_C_Add_U,
	@P_C_manage ,
	@IsDefault
	)

else 
	UPDATE  [zydn_Config_MenuPower] SET 
	P_A_View_G=@P_A_View_G ,
	P_A_View_U=@P_A_View_U,
	P_A_Add_G=@P_A_Add_G,
	P_A_Add_U=@P_A_Add_U,
	P_A_Edit_G=@P_A_Edit_G ,
	P_A_Edit_U=@P_A_Edit_U,
	P_A_Area=@P_A_Area ,
	P_A_AreaType=@P_A_AreaType ,
	P_A_manage=@P_A_manage ,
	P_A_IsExamine=@P_A_IsExamine,
	P_A_IsPower=@P_A_IsPower  ,
	P_A_Examine_1=@P_A_Examine_1 ,
	P_A_Examine_2=@P_A_Examine_2 ,
	P_A_Examine_3=@P_A_Examine_3,
	P_A_Examine_4 =@P_A_Examine_4 ,
	P_C_IsExamine=@P_C_IsExamine ,
	P_C_View_G=@P_C_View_G,
	P_C_View_U=@P_C_View_U ,
	P_C_Add_G=@P_C_Add_G,
	P_C_Add_U=@P_C_Add_U,
	P_C_manage =@P_C_manage
	
	WHERE MPName =@MPName 

if (@eof=0)
	select top 1 @powerID=id from  [zydn_Config_MenuPower]  order by id desc
else
	select @powerID=id  from  [zydn_Config_MenuPower]  where  MPName =@MPName

if (@IsDefault=1)
	update   [zydn_Config_MenuPower]   set  IsDefault=0 where  id<>@powerID

if (@IsDefault=1)
	update   [zydn_Config_MenuPower]   set  IsDefault=1 where  id=@powerID

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_SaveVot] 
@title varchar(1000) =null,
@optionName varchar(1000) =null,
@countNum varchar(1000) =null,
@isV INT =null,
@endDate int =null,
@id int =null,
@type int =null,
@outid int =null output
 AS

set @optionName=replace(@optionName,',','，')
if (@id is not null) 
   /*	delete from zydn_vot where id=@id*/
	update [zydn_Vot] set 
	title=@title,
	optionName=@optionName,
	countNum=@countNum,
	isV=@isV,
	endDate=@endDate,
	type=@type
	where id=@id
else
	insert into [zydn_Vot] 
	(
	title,
	optionName,
	countNum,
	isV,
	endDate,
	createDate,
	type
	
	)values(
	@title,
	@optionName,
	@countNum,
	@isV,
	@endDate,
	getDate(),
	@type
	
)
if (@id is not null) 
	set @outid=@id
else
	select top 1  @outid=id from zydn_vot order by id desc

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_SignFor] 
@tab varchar(200)=null,
@tabid int =null,
@toUser varchar(200)=null,
@text varchar(250)=null
AS

update  [zydn_signFor] set 
	state=1,
	leaveWord=@text,
	signForDate=getDate()
 where  tabid=@tabid  and  tab=@tab  and toUser=@toUser 

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_addUser] 
@userName varchar(50)=null,
@userPass varchar(50)=null,
@Email varchar(100) =null,
@Mobile varchar(20)=null,
@passQuestion varchar(50)=null,
@passAnswer varchar(250)=null,
@idiograph varchar(250)=null,
@aUser varchar(50)=null,
@userPhoto varchar(200)=null,
@aid int=null,
@uid  int =null output,
@outInfo int =null output

AS

Declare @isEof int
Declare @gid int
Declare  @gName varchar(100)
Declare  @Lname varchar(100)
Declare  @Lid int

set  @Lname=null
set @Lid=null 

  select @isEof=count(id)  from zydn_User_Base where [userName] =@userName

  if (@isEof!=0)
       set  @outInfo =0
 else
     set @outInfo=1

  if (@isEof=0)
    select @gName=[GroupName],@gid=[id] from [zydn_UserGroup] where [IsDefault]=1

  if (@isEof=0)
	SELECT  top 1 @Lname=[LevelName],@Lid=[id]  FROM zydn_userLevel where minInt<=0 order by minInt desc
if (@Lid is null)
    SELECT  top 1  @Lname=[LevelName],@Lid=[id]    FROM zydn_userLevel   order by minInt 


  if (@isEof=0)
     INSERT INTO [zydn_User_Base] 
	([userName],
	[PassWord],
	[Email],
	[PasQuestion],
	[PasAnswer],
	[Mobile],
	[idiograph],
	[RegDate],
	[IsLocked],
	[IsExamine],
	[ExamineUserName],
	[ExamineUserID],
	[EffectDate],
	[userPhoto],
	[Count_Login],	
	[Count_Release],
	[Count_Comment],
	[Delete_Release],
	[Delete_Comment],
	[Integral_Base],
	[Integral_Expert],
	[Integral_Total],
	[LevelName],
	[LevelID],
	[Money],
	[GroupID],
	[GroupName],
	[isAdmin]

)
	values
	( 
	@userName,
	@userPass,
	@Email ,
	@passQuestion,
	@passAnswer,
	@Mobile,
	@idiograph,
	getdate(),
	0,1,
	@aUser,
	@aid,
	null,
	@userPhoto,
	0,0,0,0,0,0,0,0,
	@Lname,
	@Lid,
	0,
	@gid,
	@gname,
	0
   	)


  if (@isEof=0)
	select top 1 @uid=id from  [zydn_User_Base]  order by id desc
else
	set @uid=-1

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_clearTable]
@tabname varchar(50)=null
 AS


Declare @sql varchar(1500)

set @sql='delete    '+@tabname
execute (@sql)

delete zydn_room where tabname=@tabname

delete zydn_review where ATab=@tabname

delete  [zydn_contribute] where tabName=@tabname

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_clearlFile]
@id int =null
 AS
Declare @fileid  int
Declare @table varchar(100) 
Declare @count int
Declare @sql varchar(1000)
Declare @userName varchar(1000)

select @fileid=tabid,@table=tabName,@userName=saveUser from zydn_room where id=@id
delete from zydn_room where id=@id
update  zydn_User_Base set  Delete_Comment =Delete_Comment+1 where UserName =@userName

select @count = count(*)   from zydn_room where tabid=@fileid and tabName=@table
if (@count=0)
	BEGIN
		   set @sql='   delete from  '+@table+' where id='+CAST(@fileid as varchar(50))+' '
		   execute (@sql)
		delete zydn_review where ATab=@table  and AID =@fileid
		
		delete  [zydn_contribute] where tabName=@table and tabId=@fileid
	end

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_clearlMenu] 
@mid int =null
AS

Declare  @idList varchar(250)
select @idList=UpListID from zydn_menu where mid=@mid
update zydn_room set isdel=1  where mid in (select mid from zydn_menu  where  mid=@mid or UpListID like @idList+',%' )
delete   zydn_menu   where  mid=@mid or UpListID like @idList+',%'

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_contributeAdd]
@title  varchar(100) =null,
@mid  int =null,
@mName varchar(100) =null,
@uID	int	=null,
@uName	nvarchar(50)=null,
@uGroup	nvarchar(100)=null,
@uGroupID	nvarchar(10)=null,
@Examine	int =null,
@tabName varchar(50)=null ,
@tabId int =null
 AS

delete   [zydn_contribute] where tabName=@tabName and tabId =@tabId 

insert into [zydn_contribute]
(
	title,mid,mName,uID,uName,uGroup,uGroupID,Examine,tabName,tabId
)
 values
(
	@title,@mid,@mName,@uID,@uName,@uGroup,@uGroupID,@Examine,@tabName,@tabId

)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_createMenu] 
@menuName varchar (255) =null,
@rid varchar(255) =null  output ,
@menuid int =null,
@idList varchar(255) =null  ,
@layer int=null,
@menuText varchar(255)=null,
@menuIndex int=null,
@menuAffiche varchar(255)=null,
@menuKey varchar(255) =null,
@asTab varchar(255) =null,
@menuIntro varchar(255)=null,
@powerid int =null,
@userInt varchar(100)=null,
@isNavigation int =null,
@isMenu int =null, 
@isHidden int =null,
@isReview int =null, 
@isHTML int =null,
@menuType int =null ,
@PageUrl varchar(255)=null, 
@templet varchar(255)=null,
@pageSize int =null,
@isHomePage int =null,
@isListFile int =null,
@TitleImg varchar(255) =null
 AS
/* 
 建立栏目的存储过程  输入要创建的栏目名, 和创建的栏目的ID 栏目的最小ID 1000
例: exec createMenu 'aabb',0,1021,''
建立好后, 返回 新建立的栏目的MID字段
*/
  if (@pageSize<=0)
	set @pageSize=1
  set @rid=null
  set @idList =null
  set @layer=0
   select top 1 @rid=mid  from zydn_menu  order by mid desc 
   if  (@rid is null)
	select @rid=1000
  else
        select @rid=@rid+1

    if (@menuid =0)
	set @idList=null
   else
	select top 1 @idList=UpListID,@layer=layer from zydn_menu where mid=@menuid

   if (@idList is null)
        INSERT INTO zydn_menu
	(
	mid,
	mname,
	uplistid,
	IndexNum,
	menuText,
	Affiche,
	menuKey,
	Intro,
	layer,
	asTab,
	UsePower,
	isNavigation,
	isMenu,
	isHidden, 
	isReview, 
	isHTML, 
	menuType,
	PageUrl, 
	templet,
	userInt,
	pageSize,
	isListFile,
	isHomePage,
	TitleImg
	) values(
	@rid,
	@menuName,
	@rid,
	@menuIndex,
	@menuText,
	@menuAffiche,
	@menuKey,
	@menuIntro,
	@layer,
	@asTab,
	@powerid,
	@isNavigation,
	@isMenu, 
	@isHidden,
	@isReview, 
	@isHTML, 
	@menuType, 
	@PageUrl, 
	@templet,
	@userInt,
	@pageSize,
	@isListFile,
	@isHomePage,
	@TitleImg
	)
   else
        INSERT INTO zydn_menu 
	(
	mid,
	mname,
	uplistid,
	IndexNum,
	menuText,
	Affiche,
	menuKey,
	Intro,
	layer,
	asTab,
	UsePower,
	isNavigation,
	isMenu,
	isHidden, 
	isReview, 
	isHTML, 
	menuType,
	PageUrl, 
	templet,
	userInt,
	pageSize,
	isListFile,
	isHomePage,
	TitleImg,
	 bbsNewCount,
	 bbsTitleCount,
	 bbsReCount
	) values(
	@rid,
	@menuName,
	@idList+','+@rid,
	@menuIndex,
	@menuText,
	@menuAffiche,
	@menuKey,
	@menuIntro,
	@layer+1,
	@asTab,
	@powerid,
	@isNavigation,
	@isMenu, 
	@isHidden,
	@isReview, 
	@isHTML, 
	@menuType, 
	@PageUrl, 
	@templet,
	@userInt,
	@pageSize,
	@isListFile,
	@isHomePage,
	@TitleImg,
	0,
	0,
	0
	)

   if (@idList  is not null)
       update zydn_menu set isDown =1 where mid = @menuid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_createRoom]  

@menuid int = null,
@tabid int = null,
@table varchar(50)=null,
@isclear int =null,
@title varchar(200)=null,
@saveUser varchar(100)=null,
@cbs varchar(500)=null
AS

  if (@isclear =1)
           delete  from zydn_room where tabid =@tabid and tabname=@table and isdel=0

   INSERT INTO [zydn_room] ([mid],[tabid],[tabname],[title],[cbs],[saveUser],[createDate],[isHTML]) values (@menuid,@tabid,@table,@title,@cbs,@saveUser,getdate(),0)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delExamine]
@tab varchar(200) =null,
@tabid varchar(1000)=null
 AS

Declare @sql varchar(1500)

set @sql='delete    '+@tab+'  where id in ('+@tabid+') '
execute (@sql)

set @sql = ' delete   zydn_room  where tabid in ('+@tabid+') and tabname = '''+@tab+''''
execute (@sql)


set @sql = ' delete   zydn_contribute  where tabid in ('+@tabid+') and tabname = '''+@tab+''''
execute (@sql)


/*
delete zydn_room where tabid in (@tabid) and tabname=@tab
*/

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delFile] 
@fileidList varchar(1000)=null,
@table varchar(50) =null,
@menuid int =null
AS
/*用于删除文件*/
Declare @sql  varchar(2000) 
set @sql='update    zydn_room set isDel=1,delDate=getDate() where tabname='''+@table+''' and mid='+CAST(@menuid as varchar(50)) +' and tabid in ('+@fileidList+')  '
execute (@sql)

set @sql='update    ['+@table+'] set isDel=1  where  id in ('+@fileidList+')  '
execute (@sql)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



/*
删除用户组,成功返回0, 匿名组不能删除返回1 默认组不能删除返回2
*/
CREATE PROCEDURE [hiweb_delGroup]
@groupid  int =null,
@outType int =null output
 AS

set @outType=0

Declare @guestid  int
Declare @defid  int
select @guestid=id from zydn_UserGroup where IsGuest=1
select  @defid  =id  from zydn_UserGroup where IsDefault=1
if (@groupid= @guestid)
	set @outType=1
if (@defid =@groupid )
	set @outType=2

if (@outType=0)
	delete  from zydn_UserGroup where id=@groupid

if (@outType=0)
	update zydn_User_Base set GroupID=replace(GroupID,CAST(@groupid as varchar(50))+',',   CAST(@defid  as  varchar(50))+','   ) where GroupID like '%'+CAST(@groupid as varchar(50))+',%'
if (@outType=0)
	set @outType=@groupid+10

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delMenu] 
@menuid  int =null,
@asTab varchar(50) =null ,
@upidList varchar(100) =null ,
@idList varchar(50)=null  output ,
@count int =null output
AS
/* 删除栏目的存储过程 */

 set  @count=0
select @idList=UpListID,@asTab=asTab   from zydn_menu where mid=@menuid
update   zydn_menu set isdel=1  where  mid=@menuid or UpListID like @idList+',%'
select @count=count(*) from zydn_menu where isdel=0 and  UpListID like @upidList+',%'
if (@count=0)
update zydn_menu set isdown=0 where UpListID=@upidList

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delMsg]
@id  int =null,
@delType varchar(10)=null
 AS
if (@delType='toUser')
	update [zydn_msg] set toDel=1 where id=@id
else
	update [zydn_msg] set fromDel=1 where id=@id

delete  from  [zydn_msg]  where  toDel=1 and fromDel=1 and id=@id

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delReview]
/*用户的回复被删除*/
@idList varchar(1000)=null
 AS

Declare @sql varchar(1000)

  set @sql=' update  zydn_User_Base set  Delete_Release=Delete_Release+(select count(0) as Num from  [zydn_review] where id in ('+@idList+')) where id in (  select   SaveUserID  from  [zydn_review] where id in ('+@idList+')    )'
   execute (@sql)



  set @sql='  delete [zydn_review] where id in ('+@idList+') '
   execute (@sql)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delUpFile]
@fileid int    =null,
@fileName varchar(50)=null output,
@filePath varchar(250)=null output

 AS

select @fileName=[FileName],@filePath=[FilePath]  from zydn_upfile where id=@fileid

delete from zydn_upfile where id=@fileid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_delmenuInt] 
@name varchar(100) =null
AS

delete from [zydn_Config_MenuInt]  where MIName=@name

update [zydn_Menu] set [UserInt]='' where [UserInt]=@name

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_displayTabSetup]
@type int =null
 AS

if (@type=1)
	BEGIN
		SELECT 
		zydn_Config_Tab.tabName, 
		zydn_Config_Tab.tabAsName, 
		 zydn_Config_Tab.DisplayType,
		 zydn_Config_Field.fName, 
		zydn_Config_Field.fAsName, 
		zydn_Config_Field.fType, 
		zydn_Config_Field.fOrder, 
		zydn_Config_Field.power, 
		zydn_Config_Field.postfix,
		 zydn_Config_Tab.ContentPage
		FROM zydn_Config_Field INNER JOIN
		      zydn_Config_Tab ON zydn_Config_Field.TID = zydn_Config_Tab.ID
	
		WHERE (zydn_Config_Field.isList = 1) OR      (zydn_Config_Field.fName = 'title') 
		ORDER BY zydn_Config_Field.TID, zydn_Config_Field.ID
	end 

if (@type=2)
BEGIN
	SELECT 
	zydn_Config_Tab.tabName, 
	zydn_Config_Tab.tabAsName, 
	 zydn_Config_Tab.DisplayType,
	 zydn_Config_Field.fName, 
	zydn_Config_Field.fAsName, 
	zydn_Config_Field.fType, 
	zydn_Config_Field.fOrder, 
	zydn_Config_Field.power, 
	zydn_Config_Field.postfix, 
	zydn_Config_Tab.ContentPage
	FROM zydn_Config_Field INNER JOIN
	      zydn_Config_Tab ON zydn_Config_Field.TID = zydn_Config_Tab.ID

	WHERE (zydn_Config_Field.isWindow = 1) OR      (zydn_Config_Field.fName = 'title')
	ORDER BY zydn_Config_Field.TID, zydn_Config_Field.ID
END

if (@type=3)
BEGIN
SELECT 
	zydn_Config_Tab.tabName, 
	zydn_Config_Tab.tabAsName, 
	 zydn_Config_Tab.DisplayType,
	 zydn_Config_Field.fName, 
	zydn_Config_Field.fAsName, 
	zydn_Config_Field.fType, 
	zydn_Config_Field.fOrder, 
	zydn_Config_Field.power, 
	zydn_Config_Field.postfix, 
	zydn_Config_Tab.ContentPage
	FROM zydn_Config_Field INNER JOIN
	      zydn_Config_Tab ON zydn_Config_Field.TID = zydn_Config_Tab.ID

	WHERE (zydn_Config_Field.isFind = 1) OR      (zydn_Config_Field.fName = 'title')
	ORDER BY zydn_Config_Field.TID, zydn_Config_Field.ID
END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_getGuestGroup] 
@groupid int =null output,
@groupName varchar(250)=null output
AS


    select top 1 
	@groupid=[id],
	@groupName=[GroupName] 
	 from zydn_UserGroup where IsGuest =1

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_int2add]
@intstr  numeric =null,
@add varchar(50)=null output

 AS

select top 1 @add=country from zydn_ip where startint<=@intstr and endint >=@intstr

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO




/* 
修改一个栏目的属性
*/
CREATE PROCEDURE [hiweb_modiMenu] 
@menuName varchar (255) =null,
@menuid int =null,
@menuText varchar(255)=null,
@menuIndex int=null,
@menuAffiche varchar(255)=null,
@menuKey varchar(255) =null,
@asTab varchar(255) =null,
@powerid int =null,
@userInt varchar(100)=null,
@setDownMenu int =null,
@menuIntro varchar(255)=null,
@isNavigation int =null,
@isMenu int =null, 
@isHidden int =null,
@isReview int =null, 
@isHTML int =null,
@menuType int =null ,
@PageUrl varchar(255)=null, 
@templet varchar(255)=null,
@setDownMenuInt int =null,
@pageSize int =null,
@isHomePage int =null,
@isListFile int =null,
@TitleImg varchar(255) = null


 AS
	if (@pageSize <=0) 
		set @pageSize=1
	

      update  zydn_menu set 
	
	mname=@menuName,
	IndexNum=@menuIndex,
	menuText=@menuText,
	Affiche=@menuAffiche,
	menuKey=@menuKey,
	Intro=@menuIntro,
	asTab=@asTab,
	usePower=@powerid ,
	isNavigation=@isNavigation,
	isMenu=@isMenu,
	isHidden=@isHidden, 
	isReview=@isReview, 
	isHTML=@isHTML, 
	menuType=@menuType,
	PageUrl=@PageUrl, 
	templet=@templet,
	userInt=@userInt,
	pageSize=@pageSize,
	isListFile=@isListFile,
	isHomePage=@isHomePage,
	TitleImg=@TitleImg


	 where mid=@menuid

if (@setDownMenu=1)
	update zydn_menu  set usePower=@powerid   where  UpListID like (select UpListID from zydn_menu where mid=@menuid)+',%'
if (@setDownMenuInt=1)
	update zydn_menu  set userInt = @userInt   where  UpListID like (select UpListID from zydn_menu where mid=@menuid)+',%'

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_modiTabClass] 
@tabName varchar (50) =null,
@tabAsName varchar(50) =null  ,
@displayType varchar(50) =null  ,
@addField varchar(255) =null  ,
@ContentPage varchar(255)=null,
@EditPage varchar(255)=null,
@tabid int =null output ,
@newid int =null output 
AS
/* 
 创建或修改一个表的显示格式表的存储过程
*/
   set @newid=0
   set @tabid=null
   select top 1 @tabid=id  from zydn_Config_Tab where tabName=@tabName 
   if  (@tabid is null)
        INSERT INTO zydn_Config_Tab(tabName,tabAsName,displayType,ContentPage,EditPage) values(@tabName,@tabAsName,@displayType,@ContentPage,@EditPage)
  else
      update zydn_Config_tab set tabName=@tabName,tabAsName=@tabAsName,displayType=@displayType,ContentPage=@ContentPage,EditPage=@EditPage where tabName=@tabName

  if (@tabid is null)
    select @newid=1

  if (@tabid is null)
       select top 1 @tabid=id from zydn_Config_Tab order by id desc

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_modiUser] 
@Email varchar(100) =null,
@Mobile varchar(20)=null,
@passQuestion varchar(50)=null,
@passAnswer varchar(250)=null,
@idiograph varchar(250)=null,
@userPhoto varchar(200)=null,
@uid  int =null 
AS

  update [zydn_user_base] set 
	[Email]=@Email,
	[Mobile]=@Mobile, 
	[PasQuestion]=@passQuestion, 
	[PasAnswer]=@passAnswer ,
	[idiograph]=@idiograph,
	[userPhoto]=@userPhoto 
	where id=@uid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE procedure  [hiweb_readData_Page]
@table varchar(50) =null,
@field varchar(1000)=null,
@order varchar(100) =null,
@where varchar(250) =null,
@pagesize int =null,
@page int =null,

@pageCount int=0 out,	--总页数
@recordCount int=0 out	--总记录数
as

set nocount on

declare @p1 int
declare @sql varchar(1000)
if (@where is not  null  and @where <>'')
    set @where =' where ' +@where
if (@order !='' and @order is not null)
   set @order =' order by ' +@order


set @sql='select '+@field+'   from ['+@table+']  '+@where +'  '+@order

exec sp_cursoropen @p1 output,@sql,@scrollopt=1,@ccopt=1,@rowcount=@pagecount output
set @recordCount = @pageCount
select @pagecount=ceiling(1.0*@pagecount/@pagesize)
	,@page=(@page-1)*@pagesize+1
exec sp_cursorfetch @p1,16,@page,@pagesize 
exec sp_cursorclose @p1

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_readData_idPage]
@table varchar(50) =null,
@field varchar(1000)=null,
@order int =null,
@where varchar(250) =null,
@pagesize int =null,
@page int =null
 AS
/*
这是一个按ID分页的存储过程  有很高的效率
@order =0 升序  非0 降序
*/

Declare @sql  varchar(2000) 
Declare @pagestr int 
Declare @where1 varchar(1000)

set @pagestr=@pagesize*(@page-1)

if (@pagestr=0) 
   set @pagestr=1

if (@where is not null and @where <>'')
	set @where1=' and '+@where
else
	set @where1=''

if (@where is not null and @where <>'')
	set @where=' where '+@where
else
 	set @where=''



set  @sql='   SELECT TOP '+CAST(@pagesize as varchar (50))+'  '+@field+'  FROM  '+@table
set @sql=@sql+' WHERE (ID > =    (SELECT Max(id)  from ( '
set @sql=@sql+ 'SELECT TOP '+CAST(@pagestr as varchar(50))+'  id  FROM '+@table+'  '+@where+'  ORDER BY id ) AS T'
set @sql=@sql+') '+@where1+' )order by id'

Declare @sql1  varchar(2000) 

set  @sql1='   SELECT TOP '+CAST(@pagesize as varchar (50))+'  '+@field+'  FROM  '+@table
set @sql1=@sql1+' WHERE (ID <  =   (SELECT Min(id)  from ( '
set @sql1=@sql1+ 'SELECT TOP '+CAST(@pagestr  as varchar(50))+'  id  FROM '+@table+'  '+@where+'   ORDER BY id desc ) AS T'
set @sql1=@sql1+') '+@where1+' )order by id desc '


/*
select @sql

select @sql1*/


if (@page=1)
	set @sql='  select top  '+CAST(@pagesize as varchar (50))+'  '+@field+'  FROM  '+@table+ ' '+ @where+'   ORDER BY id '
	/*set @sql='  select top  '+CAST(@pagesize as varchar (50))+'  '+@field+'  FROM  '+@table+ ' '+'   ORDER BY id '*/

if (@page=1)
	set @sql1='  select top  '+CAST(@pagesize as varchar (50))+'  '+@field+'  FROM  '+@table+ ' '+ @where +'   ORDER BY id  desc'



if (@order =0)
	execute (@sql)
else 
	execute (@sql1)


/* execute (@sql )*/

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_readMaxID] @rid int = null output  AS
        select top 1 @rid=mid  from zydn_menu order by mid desc
       if (@rid is null)
	select @rid=-1
      else
            select @rid=@rid+1

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveBbsPost]
@bbsid int =null,
@postType int =null,
@bbsTitle nvarchar(100)  =null,
@content ntext =null,
@outInt int =null,
@inInt int =null,
@prefix varchar(20)=null,
@menuid int =null,
@saveAddress nvarchar(100)=null,
@saveIP   varchar(50)=null,
@vote   int =null,
@saveUserID int =null,
@saveUser  varchar(50)=null,
@nDate datetime = null 
 AS

  if (@bbsid is null )
	BEGIN
		insert into [zydn_BBSMain]
		(
		title,
		content,
		saveUser,
		saveDate,
		saveUserID,
		reID,
		reUser,
		reDate,
		reUserID,
		vote,
		isTop,
		isElite,
		prefix,
		reCount,
		clickCount,
		outInt,
		inInt,
		isReDisplay,
		reUserIDList,
		titleIco,
		menuid,
		saveAddress,
		saveIP,
		postType,
		locked
		) values (
		@bbsTitle ,
		@content ,
		@saveUser,
		getDate(),
		@saveUserID,
		0,
		@saveUser,
		getDate(),
		@saveUserID,
		@vote,
		0,
		0,
		@prefix,
		0,
		0,
		0,
		0,
		0,
		'',
		'',
		@menuid,
		@saveAddress,
		@saveIP,
		@postType,
		0
		)
		
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id= @saveUserID

		Declare  @oDate datetime
		Declare  @newID int 
		select  top 1 @newID = id  from [zydn_BBSMain]  order by id desc

		select  @oDate =bbsNewDate from [zydn_menu] where mid=@menuid
		if  (@oDate = @nDate ) 
			BEGIN
			              update [zydn_menu] set bbsNewCount=bbsNewCount+1,bbsNewDate=@nDate, bbsNewTitle=@bbsTitle,bbsNewID=@newID,bbsNewUser=@saveUser,bbsTitleCount=bbsTitleCount+1  where  mid=@menuid
			END
		else
			BEGIN
			              update [zydn_menu] set bbsNewCount=1,bbsNewDate=@nDate, bbsNewTitle=@bbsTitle,bbsNewID=@newID,bbsNewUser=@saveUser,bbsTitleCount=bbsTitleCount+1  where  mid=@menuid
			END



	END
else 
	BEGIN
		update [zydn_BBSMain] set 
		title=@bbsTitle ,
		content=@content,
		prefix=@prefix
		where id=@bbsid

		
	END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



/*
保存上传文件的参数
*/
CREATE PROCEDURE [hiweb_saveFile]
@sName varchar(100)=null,
@fName varchar(100)=null,
@fPath varchar(255)=null,
@fType int =null,
@uName varchar(100)=null,
@uID int =null,
@fSize int =null,
@sexName varchar(10)=null,
@nExName varchar(10)=null,
@uIP varchar(50)=null,
@newid int =null output
 AS

INSERT INTO   [zydn_UpFile]
	([SourceName],[FileName],[FilePath],[FileType],[UpDateTime],[UpUser],[UpUserID],[FileSize],[sExName],[userCount],[uIP],[nExName])
	VALUES
	(@sName,@fName,@fPath,@fType,getDate(),@uName,@uID,@fSize,@sexName,0,@uIP,@nExName)

select top 1  @newid=id  from zydn_upfile order by id desc

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveImgSetup]
@name varchar(50) =null,
@value varchar(100)=null,
@type varchar(100)=null,
@uid int =null,
@uname varchar(100)=null,
@cid int =null,
@isSys int =1

 AS

Declare @isEof int

select  @isEof = count (*) from zydn_config where [type]=@type and cid=@cid

if (@isEof<>0)
     update [zydn_Config] set 
	[name]=@name,
	[value]=@value,
	[userid]=@uid,
	[username]=@uname,
	[isSys]=@isSys
		where  [type]=@type and cid=@cid
else
	INSERT  INTO [zydn_Config]
	(
	[name],	[value],	[type],[userid],[username],[cid],[isSys]
	)
	values
	(@name,@value,@type,@uid,@uname,@cid,@isSys)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveInt]
@MIName varchar(100)=null,
@groupid int =null,
@Art_View_Int int =null,
@Art_Add_Int int =null,
@Cmt_Add_Int int =null,
@Art_Ese_Int int =null,
@Art_Top_Int int =null,
@Art_Del_Int int =null,
@Cmt_Del_Int int =null,
@Art_Non_Int int =null,
@Art_View_Money int =null,
@art_Add_Money int =null,
@Cmt_add_Money int =null,
@isClear int =null,
@outID int output
 AS

if (@isClear=1)
	delete  from  [zydn_Config_MenuInt] where  MIName=@MIName

INSERT INTO  [zydn_Config_MenuInt] (
	Art_View_Int,
	Art_Add_Int,
	Cmt_Add_Int,
	Art_Ese_Int,
	Art_Top_Int,
	Art_Del_Int,
	Cmt_Del_Int,
	Art_Non_Int,
	Art_View_Money,
	art_Add_Money,
	Cmt_add_Money,
	MIName,
	groupid
	)
	VALUES
	(
	@Art_View_Int,
	@Art_Add_Int,
	@Cmt_Add_Int,
	@Art_Ese_Int,
	@Art_Top_Int,	
	@Art_Del_Int,
	@Cmt_Del_Int,
	@Art_Non_Int,
	@Art_View_Money,
	@art_Add_Money,
	@Cmt_add_Money,
	@MIName,
	@groupid
	)
select top 1  @outID =id  from  [zydn_Config_MenuInt]  order by id desc

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveMsg]
@title varchar(250)=null,
@content ntext =null,
@fromUser varchar(250),
@toUser varchar(250),
@erUser varchar(250) output

 AS


Declare @isUser int
set @isUser=0
set @erUser=''
select   @isUser= count(*)   from  [zydn_User_Base] where UserName=@toUser

if (@isUser=1)

	insert into [zydn_msg]
	(
	title,
	content,
	savedate,
	fromUser,
	toUser,
	isShow,
	toDel,
	fromDel
	)
	values(
	@title,
	@content,
	getDate(),
	@fromUser,
	@toUser,
	0,
	0,
	0
	)
else
	set @erUser=@toUser

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveReview] 
@tabid int =null,
@tab  varchar(255) =null,
@title varchar(100) =null,
@mid int =null,
@isExamine int =null,
@saveUser varchar(100)=null,
@saveUserID int=null,
@saveUserIP varchar(50)=null,
@saveAddress varchar(100)=null,
@Comment ntext =null,
@reid int =null
AS

Declare @L int

select top 1  @L=LevelCount from  [zydn_review]  where ATab=@tab and AID=@tabid and mid=@mid order by id desc
if @L is null or @L=0 
  set @L=1
else 
  set  @L =@L+1

INSERT  INTO [zydn_review] 
	(
	ATab,
	AID,
	MID,
	IsExamine,
	SaveUser,
	SaveUserID,
	SaveUserIP,
	SaveDate,
	SaveAddress,
	IsHide,
	Title,
	Comment,
	good,
	bad,
	review,
	LevelCount
	)
	values(
	@tab ,
	@tabid,
	@mid ,
	@isExamine,
	@saveUser ,
	@saveUserID,
	@saveUserIP,
	getDate(),
	@saveAddress,
	0,
	@title,
	@Comment ,
	0,
	0,
	0,
	@L
	)

if (@reid<>-1)
BEGIN
	update [zydn_review]  set review=review+1 where id=@reid

	
end 
update [zydn_User_Base] set Count_Release=Count_Release+1 where id=@saveUserID
Declare @sql varchar(1000)
set @sql='update  ['+@tab+']   set Count_Revert=Count_Revert+1 where id='+CAST(@tabid as varchar(100))
execute (@sql)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveSignFor] 
@tab varchar(200)=null,
@tabid int =null,
@mid int =null,
@toUser varchar(200)=null,
@endDate datetime =null,
@title varchar(200)=null
AS

Declare @isOld int 
set @isOld=0
select @isOld=count(*) from [zydn_signFor] where tabid=@tabid and  tab=@tab and toUser=@toUser

Declare @isUser int
set @isUser=0

if (@isOld=0) 
	BEGIN
	select   @isUser= count(*)   from  [zydn_User_Base] where UserName=@toUser
	if (@isUser=1)
		insert into  [zydn_signFor] 
		 (
		tabid,tab,mid,toUser,state,toDate,signForDate,endDate,fileTitle
		)
		values
		(
		@tabid,@tab,@mid,@toUser,0,getDate(),null,@endDate,@title
		)

	END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveUserConfig]
@fieldName varchar(50)=null,
@fieldAsname varchar(50)=null,
@isFind int =null,
@isNull int =null,
@editMode int =null,
@isRow int =null,
@isClear int =null
 AS

Declare @maxid  int

if (@isClear=1)
	delete from [zydn_ConfigUser]


INSERT INTO  [zydn_ConfigUser] 
	(
	[fieldName],
	[fieldAsName],
	[isFind],
	[isNull],
	[isRow],
	[editMode]
	)
	values
	(
	@fieldName,
	@fieldAsname,
	@isFind,
	@isNull,
	@isRow,
	@editMode
	)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_saveWebInfo] 
@sTime varchar(500) =null,
@inCount varchar(500) =null,
@eTime varchar(500) =null,
@isEnd varchar(500) =null,
@isWeb varchar(500) =null,
@tTime varchar(500) =null,
@webCode varchar(500) =null
AS

	insert into [zydn_web]
		(
			sTime,inCount,eTime,isEnd,isWeb,tTime,webCode
		) 
		values
		(
			@sTime,@inCount,@eTime,@isEnd,@isWeb,@tTime,@webCode
		)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_save_GroupName]
@groupName varchar(50) =null,
@groupid int =null
 AS
if (@groupid is null)
	insert into [zydn_userGroup] 
	(
	GroupName,
	IsDefault,
	isGuest
	)
	values
	(
	@groupName,
	0,
	0
	)
else
	update [zydn_userGroup] set [GroupName]=@groupName where id=@groupid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_setDefaultGroup]
@groupid int =null
 AS


update zydn_UserGroup set IsDefault =0
update zydn_UserGroup set IsDefault =1 where id=@groupid

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_setGuestGroup]
@groupid int =null
 AS


update zydn_UserGroup set IsGuest =0
update zydn_UserGroup set IsGuest =1 where id=@groupid


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_setPass]
@userName varchar(200)=null,
@userEmail varchar(30)=null,
@userA varchar (200)=null,
@newPass varchar(32)=null
 AS


Declare  @isU  int 

select @isU=count(0)  from  [zydn_User_Base] where PasAnswer=@userA and  UserName=@userName  and Email =@userEmail

if (@isU=1)
	BEGIN
	        update   [zydn_User_Base] set PassWord=@newPass  where PasAnswer=@userA and  UserName=@userName  and Email =@userEmail
	
	END





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_unDelFile]
@id int =null,
@type int =null output
 AS
Declare @mid  int
set @mid=null
Declare @sql varchar(1000)
Declare @table varchar(100)
Declare @tabid varchar(15)


select @mid=mid  from zydn_menu where isdel=0 and  mid=(select mid  from zydn_room where id=@id)
select @table=tabname,@tabid=tabid  from zydn_room  where  id=@id

if (@mid is not null)
	BEGIN
		update zydn_room  set isdel=0  where id=@id
		set @sql='update    ['+@table+'] set isDel=0  where  id = '+@tabid+'  '
		execute (@sql)
	END

if (@mid is not null)
   set  @type=1
else
  set @type=0

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_unDelMenu]
@mid int =null
 AS

Declare  @idList varchar(250)

select @idList=UpListID from zydn_menu where mid=@mid

update  zydn_menu  set isdel=0   where  mid=@mid or UpListID like @idList+',%'

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE  [hiweb_upPrxy] @pName varchar(50)=null ,@x int=null, @y int =null AS

update zydn_desktop set x=@x,y=@y where pName=@pName

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_userLogin]
@userName varchar (50) =null ,
@userPass varchar(50)=null,
@Last_IP varchar(50) =null,
@addInt int =null,

@pas1 varchar(50)=null output,
@GroupID varchar(100) =null output,
@GroupName varchar(250)=null output,
@Money int =null output,
@LevelID int =null output,
@Integral_Base int =null output,
@Count_Login int =null output,
@Email varchar(50) =null output,
@type int =null output,
@uid int =null output,
@isAdmin int= null output
 AS

set @type=0

Declare @effDate dateTime

select top 1
	@pas1=[PassWord],
	@uid=[ID],
	@GroupID=[GroupID],
	@GroupName=[GroupName],
	@Money=[Money ],
	@LevelID=[LevelID],
	@Integral_Base=[Integral_Base] ,
	@Email=[Email],
	@effDate =[EffectDate],
	@isAdmin=isAdmin,
	@Count_Login=Count_Login
	from zydn_user_base 
		 where userName=@userName and isLocked=0 and IsExamine=1 
if (@uid is null)
set @type=1

if  (@pas1 <>@userPass and  @type=0)
 set  @type=2

if (@effDate  is not  null  and  @effDate<getDate())
	set @type=3

if (@type=0 and @addInt>0)
	BEGIN
		update zydn_user_base set 
			Integral_Base=Integral_Base+@addInt ,
			Count_Login=Count_Login+1,Date_Login=getDate() 
		where id=@uid
		set @Count_Login=@Count_Login+1
	END

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

