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

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

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

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

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_DelMenuDelete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_DelMenuDelete]
GO

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_ExtabModi_tab_BSZN]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_BSZN]
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_LY]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_LY]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_ExtabModi_tab_Music]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_Music]
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_RLZY]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_RLZY]
GO

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

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

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_ExtabModi_tab_csArticle]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_csArticle]
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_groupDay]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_groupDay]
GO

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

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

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

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

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_ExtabModi_tab_sAndD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_sAndD]
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_transaction]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_transaction]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_ExtabModi_tab_userday]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_userday]
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_ExtabModi_tab_webService]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_ExtabModi_tab_webService]
GO

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_Favrite]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_Favrite]
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_SaveTabInt]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_SaveTabInt]
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_TenderSave]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_TenderSave]
GO

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_addFriend]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_addFriend]
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_changeMidKey]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_changeMidKey]
GO

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_checkUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_checkUser]
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_createBunch]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_createBunch]
GO

if exists (select * from sysobjects where id = object_id(N'[hiweb_createLabelIco]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_createLabelIco]
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_delBbsMain]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delBbsMain]
GO

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

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

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_delExChangeItem]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delExChangeItem]
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_delFriend]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delFriend]
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_delIntpuFile]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delIntpuFile]
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_delMyCartItem]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delMyCartItem]
GO

if exists (select * from sysobjects where id = object_id(N'[hiweb_delOneDate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delOneDate]
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_delTender]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_delTender]
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_exchange_pass]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_exchange_pass]
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_hasCart]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_hasCart]
GO

if exists (select * from sysobjects where id = object_id(N'[hiweb_inputBBS]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_inputBBS]
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_isTender]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_isTender]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_logOutBunch]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_logOutBunch]
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_orderList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_orderList]
GO

if exists (select * from sysobjects where id = object_id(N'[hiweb_orderListLog]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_orderListLog]
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_saveBbsLog]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveBbsLog]
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_saveBbsRe]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveBbsRe]
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_saveMultiyGoods]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveMultiyGoods]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_saveOrderByCart]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveOrderByCart]
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_saveTData]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveTData]
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_saveUserModiContent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_saveUserModiContent]
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_setBbsElite]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_setBbsElite]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_setDateNewDate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_setDateNewDate]
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_setNewField]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_setNewField]
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_setUserLevel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_setUserLevel]
GO

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

if exists (select * from sysobjects where id = object_id(N'[hiweb_tender_isOver]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_tender_isOver]
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_updateEcChange_state]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_updateEcChange_state]
GO

if exists (select * from sysobjects where id = object_id(N'[hiweb_updateExChange_Rate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [hiweb_updateExChange_Rate]
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'[zydn_home_Initialization]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [zydn_home_Initialization]
GO

if exists (select * from sysobjects where id = object_id(N'[tab_BSZN]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_BSZN]
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_LY]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_LY]
GO

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

if exists (select * from sysobjects where id = object_id(N'[tab_Music]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_Music]
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_RLZY]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_RLZY]
GO

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

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[tab_articledown]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_articledown]
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_groupDay]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_groupDay]
GO

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

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[tab_sAndD]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_sAndD]
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_transaction]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_transaction]
GO

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

if exists (select * from sysobjects where id = object_id(N'[tab_userday]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_userday]
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'[tab_webService]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_webService]
GO

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

if exists (select * from sysobjects where id = object_id(N'[tab_xyl]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [tab_xyl]
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_Backup]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_Backup]
GO

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

if exists (select * from sysobjects where id = object_id(N'[zydn_Competence]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_Competence]
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_EmailTemplates]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_EmailTemplates]
GO

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

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

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

if exists (select * from sysobjects where id = object_id(N'[zydn_Favorite]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_Favorite]
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_OrderList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_OrderList]
GO

if exists (select * from sysobjects where id = object_id(N'[zydn_OrderType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_OrderType]
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_Shop_MidKey]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_Shop_MidKey]
GO

if exists (select * from sysobjects where id = object_id(N'[zydn_Shop_PayList]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_Shop_PayList]
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_applyExamineHostory]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_applyExamineHostory]
GO

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[zydn_applySubjectClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_applySubjectClass]
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_bunchBase]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_bunchBase]
GO

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

if exists (select * from sysobjects where id = object_id(N'[zydn_bunchUser]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_bunchUser]
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_friend]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_friend]
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_labelType]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_labelType]
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_orderDeliver]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_orderDeliver]
GO

if exists (select * from sysobjects where id = object_id(N'[zydn_orderListLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_orderListLog]
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_setPlan]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_setPlan]
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_tabInt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_tabInt]
GO

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

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

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

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

if exists (select * from sysobjects where id = object_id(N'[zydn_useInt]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [zydn_useInt]
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_BSZN] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SLJG] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FWBH] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SLCK] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[XBJG] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[FWLX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SBDX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SBCL] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[SBZG] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BLDZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[BLYJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SFBZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SLSJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXDH] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TSDH] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[HWWZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LCT] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
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 ,
	[DQ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) 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 ,
	[download] [nvarchar] (212) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_LY] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[TEL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EMAIL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXR] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_MAIL] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DD] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXDH] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXDZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[XM] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SEX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[XJLX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXSJ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EMAIL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[GZDW] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_Music] (
	[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] (250) 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 ,
	[GS] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZC] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZQ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[FX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LD] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DZ] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[playUrl] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SINGER] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[LRCWORD] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS 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] (250) 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 ,
	[LYR] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[DQ] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[LXFS] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_RLZY] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[DZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TEL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DW] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZW] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zy] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_Registration] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[SEX] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[LL] [int] NULL ,
	[DZ] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[TEL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[QQ] [numeric](18, 3) NULL ,
	[FS] [int] NULL ,
	[MM] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[QQ2] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_Results] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[XH] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[YY] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[WL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[HX] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZZ] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[DL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[EW] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[LS] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ZF] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_SGSZ] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_Survey] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_USERPHOTO] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] 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 ,
	[IMG5] [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 ,
	[PS1] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_articledown] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[loadAddress] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Weight] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[address] [nvarchar] (213) COLLATE Chinese_PRC_CI_AS NULL ,
	[time] [datetime] 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_groupDay] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_groupMusic] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[PLAYURL] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[MTYPE] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_groupPhoto] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] 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 ,
	[IMG5] [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 ,
	[PS1] [nvarchar] (211) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_lgq] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[address] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[student] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_note] (
	[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] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (150) 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] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (150) 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] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[day] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[weather] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[feel] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ADD] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_pepole] (
	[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] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SaveUserID] [int] NULL ,
	[SaveUserIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[IPaddress] [nvarchar] (150) 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] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[title] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Kind] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[TabImage] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabKeys] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[CBS] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[inquiry] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Source] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[SourceUrl] [nvarchar] (150) 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] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[upRecord] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[downRecord] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[upid] [int] NULL ,
	[downid] [int] NULL ,
	[sex] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[age] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_sAndD] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[pic] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ver] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[SIZE] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UPTIME] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [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 ,
	[TAB_PREICE] [numeric](18, 3) NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) 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 ,
	[txt] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_transaction] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_userMusic] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[PLAYURL] [nvarchar] (217) COLLATE Chinese_PRC_CI_AS NULL ,
	[MTYPE] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_userday] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[shopStock] [int] 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_webService] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[price] [int] NULL ,
	[news] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[flash] [nvarchar] (212) COLLATE Chinese_PRC_CI_AS NULL ,
	[fabu] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[bijiao] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[diaocha] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[liuyan] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[bbs] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[pinglun] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[picguanli] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[webhtml] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[blog] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[musiconline] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[videoonline] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zhifuonline] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CJsearch] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[scoresearch] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[baomingonline] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[fankuai] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[jubao] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[leadermail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[vip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[vipjifen] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[user] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[control] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[sqldb] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[aspnet] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[shengji] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[zhuji] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[url] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[beian] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[design] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[chanquan] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[data] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[seo] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[help] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[banben] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_webUrl] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopStock] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [tab_xyl] (
	[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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (150) 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 ,
	[isDel] [tinyint] NULL ,
	[endTime] [datetime] 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 ,
	[menuid] [int] NULL ,
	[isDel] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_Backup] (
	[backUserID] [int] NULL ,
	[bcakUserName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backFileNum] [int] NULL ,
	[backFileSize] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backCreateDate] [datetime] NULL ,
	[backIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backFileName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backFilePath] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backupSize] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[backHave] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_BbsLog] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[mainID] [int] NULL ,
	[reID] [int] NULL ,
	[userName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[saveUserName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUserID] [int] NULL ,
	[saveDate] [datetime] NULL ,
	[saveType] [tinyint] NULL ,
	[mainTitle] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[mInt] [int] NULL ,
	[mType] [tinyint] NULL ,
	[mText] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Competence] (
	[cpName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) 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] (300) 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 ,
	[isEdit] [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] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_View_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Add_G] [nvarchar] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Add_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_Edit_G] [nvarchar] (600) 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] (600) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_View_U] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[P_C_Add_G] [nvarchar] (600) 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 ,
	[P_A_SignFor_G] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[P_A_SignFor_U] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_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_EmailTemplates] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[tempName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Theme] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [nvarchar] (4000) COLLATE Chinese_PRC_CI_AS NULL ,
	[ip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[uID] [int] NULL ,
	[uName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_ExChange] (
	[orderNum] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmCity] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmNum] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmEmail] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmTel] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmStart] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apmEnd] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[selectDate] [datetime] NULL ,
	[selectTime] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[selectAddress] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[moneyType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveDate] [datetime] NULL ,
	[saveUserName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUserID] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[state] [int] NULL ,
	[stateName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[updateDate] [datetime] NULL ,
	[inMoney] [numeric](18, 0) NULL ,
	[outMoney] [numeric](18, 0) NULL ,
	[pathName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[askType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[moneyTypeID] [int] NULL ,
	[payTab] [int] NULL ,
	[payDate] [datetime] NULL ,
	[payMoney] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_ExChangeIndex] (
	[exID] [int] NULL ,
	[state] [int] NULL ,
	[stateName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[createDate] [datetime] NULL ,
	[createIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[createUser] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[createUserID] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[remark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[orderNum] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[orderCreateTime] [datetime] NULL ,
	[orderCreateName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_ExChangeMoney] (
	[exID] [int] NULL ,
	[type] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[moneyType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[money] [numeric](18, 0) NULL ,
	[runMoney] [numeric](18, 0) NULL ,
	[Rate] [numeric](18, 0) NULL ,
	[ckfl] [numeric](18, 0) NULL ,
	[orderNum] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[createDate] [datetime] NULL ,
	[price] [numeric](18, 0) NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Favorite] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[uid] [int] NULL ,
	[uname] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[createDate] [datetime] NULL ,
	[fType] [int] NULL ,
	[tabId] [int] NULL ,
	[tabName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[vText] [nvarchar] (250) 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] (500) COLLATE Chinese_PRC_CI_AS NULL ,
	[Affiche] [nvarchar] (2800) 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 ,
	[menuClickCount] [int] NULL ,
	[isTop] [tinyint] NULL ,
	[isFind] [tinyint] NULL ,
	[isChildHome] [tinyint] NULL ,
	[displayMode] [tinyint] NULL ,
	[intName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS 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_OrderList] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[OrderID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[UserID] [int] NULL ,
	[UserName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CommodityName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TypeID] [int] NULL ,
	[Price] [numeric](10, 2) NULL ,
	[CommodityNum] [int] NULL ,
	[Total] [numeric](10, 2) NULL ,
	[CreateTime] [datetime] NULL ,
	[Mark] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TabID] [int] NULL ,
	[IP] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Address] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[OrderState] [tinyint] NULL ,
	[SellerID] [int] NULL ,
	[SellerName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeStar] [datetime] NULL ,
	[TimeEnd] [datetime] NULL ,
	[ColumName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[ColumID] [int] NULL ,
	[UpdateStateTime] [datetime] NULL ,
	[TypeName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isCart] [tinyint] NULL ,
	[DeliverID] [int] NULL ,
	[field] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_OrderType] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[TypeName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeStart] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[TimeEnd] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[Num] [tinyint] NULL ,
	[TypePrice] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[Expiration] [int] NULL 
) 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_Shop_MidKey] (
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[payMid] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[payKey] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[netBankName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[isUse] [tinyint] NULL ,
	[netBank] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_Shop_PayList] (
	[v_oid] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[v_pstatus] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[v_pstring] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[v_pmode] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[v_amount] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[v_moneytype] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[remark1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[remark2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[payDate] [datetime] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[netBankName] [nvarchar] (150) 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] (250) 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 ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[gqlb] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music1] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[music2] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[competenceID] [int] NULL ,
	[typeMenuID] [int] NULL ,
	[bunchid] [int] NULL ,
	[intName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS 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 ,
	[EXIF] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[fileTitle] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[fileCBS] [nvarchar] (255) 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] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[sex] [tinyint] NULL ,
	[isHome] [tinyint] NULL ,
	[createHomeDate] [datetime] NULL ,
	[homeClickCount] [int] NULL ,
	[scoringTable] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[shopShould] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[referee] [int] NULL ,
	[refereeName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[personalPro] [int] NULL ,
	[moneyPro] [int] NULL ,
	[luckPro] [int] 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_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_applyExamineHostory] (
	[examineUID] [int] NULL ,
	[examineUName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[examineDate] [datetime] NULL ,
	[examineRemark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyBMID] [int] NULL ,
	[applyID] [int] NULL ,
	[applyName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[isPassExamine] [tinyint] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_applyProjectBase] (
	[applyTabName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyTabAsName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyCreateDate] [datetime] NULL ,
	[applyCreateUID] [int] NULL ,
	[applyCreateUName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyCreateIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyLastEditorDate] [datetime] NULL ,
	[applyProcess] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[applyStarDate] [datetime] NULL ,
	[applyEndDate] [datetime] NULL ,
	[applyPermit] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[permitRemark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[isTab] [tinyint] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_applyProjectFor] (
	[applyTabID] [int] NULL ,
	[applyTabName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyTabAsName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apyName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apyAsName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apyRemark] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apyType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[apySize] [int] NULL ,
	[apyEditType] [int] NULL ,
	[apyIsNull] [tinyint] NULL ,
	[apyCss] [tinyint] NULL ,
	[apyClassID] [int] NULL ,
	[addprint] [tinyint] NULL ,
	[indexTop] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_applyProjectSubject] (
	[applyTabID] [int] NULL ,
	[applyTabName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[applyTabAsName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[subJectName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[subJectAsName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[subJectreMark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[subJectDate] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[subJectCalculation] [numeric](18, 0) NULL ,
	[isCalculation] [tinyint] NULL ,
	[fType] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[fSize] [int] NULL ,
	[fEditType] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_applyRapidResponse] (
	[responseTitle] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[responseContent] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[cDate] [datetime] NULL ,
	[cUserID] [int] NULL ,
	[cUserName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_applySubjectClass] (
	[className] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[classImg] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[classRemart] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[classStyle] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[indexTop] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT 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_bunchBase] (
	[bunchName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[cuserid] [int] NULL ,
	[cuserName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[cip] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[cdate] [datetime] NULL ,
	[isDel] [tinyint] NULL ,
	[note] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[bunchPhoto] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[homeClickCount] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_bunchCompetence] (
	[bcpName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_bunchUser] (
	[userid] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[bunchid] [int] NULL ,
	[bunchName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[jdate] [datetime] NULL ,
	[jip] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[isMain] [tinyint] NULL ,
	[isHave] [tinyint] 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 ,
	[createDate] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_friend] (
	[userid] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[fuserid] [int] NULL ,
	[fuserName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[jdate] [datetime] NULL ,
	[isHave] [tinyint] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT 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_labelType] (
	[typeName] [nvarchar] (150) 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 ,
	[menuid] [int] NULL ,
	[tabName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[menuName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[dataType] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_orderDeliver] (
	[TEL] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[address] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[code] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[name] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[Phone] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_orderListLog] (
	[mid] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[uGroupName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[uGroupID] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[IP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[changeTime] [datetime] NULL ,
	[oldPrice] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[newPrice] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[CommodityName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[orderID] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT 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 ,
	[Examine] [tinyint] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_setPlan] (
	[mid] [int] NULL ,
	[userID] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[planName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[planMark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[path] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[pAwardsInt] [int] NULL ,
	[pAwardsMoney] [int] NULL ,
	[planTime] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[isOK] [tinyint] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_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 ,
	[IP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_tabInt] (
	[tabid] [int] NULL ,
	[tabname] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[dispInt] [int] NULL ,
	[dispMoney] [int] NULL ,
	[AwardsInt] [int] NULL ,
	[AwardsMoney] [int] NULL ,
	[saveUser] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[saveUserID] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_tender] (
	[userID] [int] NULL ,
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[planID] [int] NULL ,
	[mark] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[path] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[isOK] [tinyint] NULL ,
	[isPay] [tinyint] NULL ,
	[tenderTime] [datetime] NULL ,
	[tenderIP] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[tenderAddress] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_type] (
	[typeName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [zydn_typeMenu] (
	[groupname] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[typeid] [int] NULL ,
	[typename] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userid] [int] NULL ,
	[username] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[cdate] [datetime] NULL ,
	[cip] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[ClusterID] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[photo] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[note] [ntext] COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_uModiContent] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[menuid] [int] NULL ,
	[menuName] [nvarchar] (70) COLLATE Chinese_PRC_CI_AS NULL ,
	[tabid] [int] NULL ,
	[tab] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[tabTitle] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[Content] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[userIP] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
	[createTime] [datetime] NULL ,
	[userID] [int] NULL ,
	[userName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[setType] [tinyint] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [zydn_useInt] (
	[userName] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[userID] [int] NULL ,
	[intNum] [int] NULL ,
	[moneyNum] [int] NULL ,
	[createDate] [datetime] NULL ,
	[title] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[tab] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[tabid] [int] NULL ,
	[ID] [int] IDENTITY (1, 1) NOT 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 ,
	[levelImg] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
	[intIntegral] [int] NULL ,
	[intMoney] [int] NULL ,
	[intShopShould] [int] NULL ,
	[uIntegral] [int] NULL ,
	[uMoney] [int] NULL ,
	[uShopShould] [int] NULL ,
	[intUIntegral] [int] NULL ,
	[intUMoney] [int] NULL ,
	[intUShopShould] [int] NULL ,
	[color] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS 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 ,
	[buySn] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [tab_BSZN] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_BSZN] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_LY] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_LY] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [tab_Music] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_Music] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_RLZY] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_RLZY] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

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

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

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

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

ALTER TABLE [tab_articledown] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_articledown] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_groupDay] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_groupDay] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

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

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

ALTER TABLE [tab_note] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [tab_pepole] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [tab_sAndD] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_sAndD] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_transaction] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_transaction] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [tab_userday] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_userday] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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 [tab_webService] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_webService] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [tab_xyl] WITH NOCHECK ADD 
	CONSTRAINT [PK_tab_xyl] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_Backup] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_Competence] WITH NOCHECK ADD 
	 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_EmailTemplates] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_EmailTemplates] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_ExChange] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_ExChangeIndex] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_ExChangeMoney] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Favorite] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_Favorite] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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]
	)  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_OrderList] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_OrderList] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_OrderType] WITH NOCHECK ADD 
	CONSTRAINT [PK_zydn_OrderType] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_Shop_MidKey] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_Shop_PayList] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_applyExamineHostory] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_applyProjectBase] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_applyProjectFor] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_applyProjectSubject] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_applyRapidResponse] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_applySubjectClass] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_bunchBase] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_bunchCompetence] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_bunchUser] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_friend] WITH NOCHECK ADD 
	 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_labelType] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_orderDeliver] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_orderListLog] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_setPlan] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_tabInt] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_tender] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_type] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [zydn_typeMenu] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

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

ALTER TABLE [zydn_useInt] WITH NOCHECK ADD 
	 PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  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_tab_BSZN] ON [tab_BSZN]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
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_tab_LY] ON [tab_LY]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
GO

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

 CREATE  INDEX [IX_tab_tab_Music] ON [tab_Music]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) 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_tab_RLZY] ON [tab_RLZY]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
GO

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

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

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

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

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

 CREATE  INDEX [IX_tab_tab_articledown] ON [tab_articledown]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) 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_tab_groupDay] ON [tab_groupDay]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
GO

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

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

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

 CREATE  INDEX [IX_tab_tab_sAndD] ON [tab_sAndD]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) 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], [menuid]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

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

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

 CREATE  INDEX [IX_tab_tab_userday] ON [tab_userday]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) 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_tab_tab_webService] ON [tab_webService]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) ON [PRIMARY]
GO

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

 CREATE  INDEX [IX_tab_tab_xyl] ON [tab_xyl]([Count_Click], [Count_Down], [IsEssence], [isDel], [IsTop], [IsHidden], [Examine]) 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_User_extend] ON [zydn_User_extend]([UID]) 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 E_addUser
  @userName nvarchar(250) =null,
	 @userPwd nvarchar(100)=null,
	 @Email nvarchar(100)=null,
	 @Mobile nvarchar(50)=null,
	 @aUser nvarchar(100)=null,
	 @aid int =null,
	  @gid int =null,
	 @gName nvarchar(100)=null,
	 @out int =null output
AS
	/* SET NOCOUNT ON */ 
	
Declare @isUser int
Declare @newid int 
select @isUser=count(0) from [zydn_User_Base] where UserName=@userName
if (@isUser=0)
	BEGIN
	if (@gid is null)
	 select @gName=[GroupName],@gid=[id] from [zydn_UserGroup] where [IsDefault]=1	
	
	 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,
	@userPwd,
	@Email ,
	null,
	null,
	@Mobile,
	'',
	getdate(),
	0,
	1,
	@aUser,
	@aid,
	null,
	null,
	0,0,0,0,0,0,0,0,
	null,
	null,
	0,
	@gid,
	@gname,
	0
   	)
   	
   	select @newid=max(id) from [zydn_User_Base]
	insert into [zydn_User_extend](UID) values(@newid)
	END
else
	BEGIN
		set @out=@isUser
	END





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO



/*保存支付结果信息*/
CREATE proc exChange_Pay_Resoult
(
	@merchantAcctId nvarchar(50)=null,/*------------获取人民币网关账户号----*/
        @signType int=null,/*-----------------------签名类型.固定值----*/
        @payType nvarchar(50)=null,/*-----------------------获取支付方式    ----*/  
        @bankId nvarchar(50)=null, /*-----------------------获取银行代码----*/                            
        @orderId nvarchar(100)=null, /*-----------------------获取商户订单号----*/
        @orderTime datetime=null,/*-----------------------获取订单提交时间----*/
        @orderAmount numeric(9,2)=null,/*--------获取原始订单金额----*/
        @dealId nvarchar(50)=null,/*-----------------------获取快钱交易号----*/
        @dealTime datetime=null,/*-----------------------获取在快钱交易时间----*/
        @payAmount numeric(9,2)=null,/*-----------------------获取实际支付金额----*/
        @fee numeric(9,2)=null,/*-----------------------获取交易手续费----*/
        @ext1 nvarchar(1000)=null,/*-----------------------获取扩展字段----*/
        @ext2 nvarchar(1000)=null,/*-----------------------获取扩展字段----*/
        @payResult nvarchar(50)=null /*-----------------------获取处理结果----*/
)
as
begin transaction
	declare @payName nvarchar(50)/*----------支付银行名称--------------*/
	declare @bankName nvarchar(50)/*----------支付银行名称--------------*/		
		     select @payName=( 
			case 
				when @payType='00' then '其他支付'
                                when @payType='10' then '银行卡网银支付'
                                when @payType='11' then '电话支付'
                                when @payType='12' then '块钱账户支付'
                                when @payType='13' then '线下支付'
                                when @payType='14' then '企业网页在线支付'
                                when @payType='15' then '信用卡支付'           
                                when @payType='17' then '预付卡支付'
				else ''	end )

			 select @bankName=( 
			     case    
				when @bankId='ICBC'  then '中国工商银行'
                                when @bankId='CMB'   then '招商银行'
                                when @bankId='CCB'   then '中国建设银行'
                                when @bankId='ABC'   then '中国农业银行'
                                when @bankId='BOC'   then '中国银行'
                                when @bankId='SPD'   then '上海浦东发展银行'
                                when @bankId='BCOM'  then '交通银行'
                                when @bankId='CMBC'  then '中国民生银行'
                                when @bankId='SDB'   then '深圳发展银行'
                                when @bankId='GDB'   then '广东发展银行'
                                when @bankId='CITIC' then '中信银行'
                                when @bankId='HXB'   then '华夏银行'
                                when @bankId='CIB'   then '兴业银行'
                                when @bankId='GZRCC' then '广州市农村信用合作社'
                                when @bankId='GZCB'  then '广州市商业银行'
                                when @bankId='SHRCC' then '上海农村商业银行'
                                when @bankId='CPSRB' then '中国邮政储蓄'
                                when @bankId='CEB'   then '中国光大银行'
                                when @bankId='NJCB'  then '南京银行'
                                when @bankId='BEA'   then '东亚银行'
                                when @bankId='BOB'   then '北京银行'
                                when @bankId='CBHB'  then '渤海银行'
                                when @bankId='BJRCB' then '北京农村商业银行'
                                when @bankId='CNPY'  then '中国银联'
                                when @bankId='PAB'   then '平安银行'
                                when @bankId='HSB'   then '徽商银行'
                                when @bankId='SHB'   then '上海银行'
                                when @bankId='HZB'   then '杭州银行'
                                when @bankId='NBCB'  then '宁波银行'
				else '' end  
			   )
	declare @exId int
	declare @exName nvarchar(100)
	declare @exNum nvarchar(100)
	select @exId=id,@exName=apmName,@exNum=apmNum from zydn_ExChange where  payTab=0  and moneyTypeID=3 and state=1 and outMoney>0  and orderNum=@orderId
	if(@exId>0)
	begin
		declare @id int
		insert into exChange_PayResoult(merchantAcctId,signType,payType,payName,bankId,bankName,orderId,
						orderTime,orderAmount,dealId,dealTime,payAmount,fee,ext1,ext2,payResult,
						exId,exName,exNum)  
					values(@merchantAcctId,@signType,@payType,@payName,@bankId,@bankName,@orderId,
						@orderTime,@payAmount/100,@dealId,@dealTime,@payAmount/100,@fee/100,@ext1,@ext2,@payResult,
						@exId,@exName,@exNum)  
		if @@error<>0
		rollback transaction
		set @id=@@identity
		
		update zydn_ExChange set payTab=@id,payDate=getdate(),payMoney=@payAmount/100 where id=@exId and orderNum=@orderId
		if @@error<>0
		rollback transaction
 	end
commit transaction


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO



CREATE PROCEDURE [hiweb_AddIP]
@sIP nvarchar(30)=null,
@eIP nvarchar(30)=null,
@sInt numeric=NULL,
@eInt numeric=null,
@leftStr nvarchar(50) =null,
@addStr nvarchar(100)=null
 AS


Declare @id int 

select  @id=id   from zydn_area where addname=@leftStr
if (@id is null)
 BEGIN  
	insert into [zydn_area]  (addname,num) values(@leftStr , 1)

 END
else
  BEGIN  
	update [zydn_area] set num=num+1 where id=@id
  END



insert into zydn_ip   ([startip],[endip],[country],[startint],[endint],[left2]) values (@sIP,@eIP,@addStr,@sInt,@eInt,@leftStr)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO





CREATE PROCEDURE [hiweb_ApproveBunch]
@id  int =null,
@aType int =null,
@uid int =null,
@outType int =null output
 AS
/*处理一个用户加入某群的申请*/

declare @isMain  int 


select @isMain =count(0)  from [zydn_bunchBase] where cuserid =@uid  and  [id] = (select  bunchid   from  [zydn_bunchUser]  where  [id] =@id)

if (@isMain =0 )
  BEGIN  
	set @outType=-1

  END
else
  BEGIN
	if (@aType=1) 
		BEGIN
			update  [zydn_bunchUser]  set  isHave=1 where id=@id
			set @outType=-2
		END
	else
		BEGIN
			delete [zydn_bunchUser] where id=@id
			set @outType =-3
		END
  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_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 nvarchar(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 nvarchar(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 ON 
GO
SET ANSI_NULLS ON 
GO





-------/并且将栏目中的内容全部删除-----
CREATE proc hiweb_DelMenuDelete
(
  @tab nvarchar(100)=null,
  @menuid int=null,
  @tabid int=null
)
as
begin transaction
  declare @sql nvarchar(3000)
  set @sql='delete from '+@tab+' where id='+convert(nvarchar(50),@tabid)
  exec(@sql)
  if @@error<>0
  rollback transaction

  delete from zydn_room where tabid=@tabid and tabname=@tab

  if @@error<>0
  rollback transaction

  
  commit transaction



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO






-------/删除栏目,并且将栏目移动到最前一个栏目当中-----
CREATE proc hiweb_DelMenuRemove
(
  @tab nvarchar(100)=null,
  @menuid int=null
)
as
begin transaction
  declare @saveuserid int--/保存人的编号
  declare @bunchid int-----/群编号
  declare @nowMenuid int---/新栏目编号 
  declare @typeid int-----/类型编号 

  select  @saveuserid=userid,@typeid=typeid,@bunchid=ClusterID from zydn_typeMenu where [id]=@menuid
  
  select @nowMenuid=([id]) from zydn_typeMenu where ClusterID=@bunchid and userid=@saveuserid and typeid=@typeid and [id]<>@menuid order by id desc
 
 
  declare @sql nvarchar(3000)
  set @sql='update '+@tab+' set typeMenuID='+convert(nvarchar(50),@nowMenuid)+' where bunchid='+convert(nvarchar(50),@bunchid)+' and typeMenuID='+convert(nvarchar(50),@menuid)  
  exec(@sql)
  if @@error<>0
  rollback transaction


  delete from zydn_typeMenu where [id]=@menuid
  if @@error<>0
  rollback transaction

  commit transaction



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





--------/删除栏目

CREATE proc hiweb_DelMenuType
(  
  @menuid int=null
)
as
begin

  delete from zydn_typeMenu where id=@menuid

end



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





CREATE proc hiweb_DelZDTable
(
  @tab nvarchar(100)=null,---/表名
  @whe nvarchar(2000)
)
as
begin

 declare @sql nvarchar(3000)
 set @sql='delete from '+@tab+' where  '+@whe
 exec(@sql)

end



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




CREATE proc hiweb_ExChange_Base
(	
	@updateDateIndex int=null,--/ 0 插入新数据 
	@orderNum nvarchar(50)=null,--/订单好
	@apmName nvarchar(50)=null,--/姓名
	@apmCity nvarchar(50)=null,--/国际
	@apmNum	 nvarchar(50)=null,--/证件号码
	@apmType nvarchar(50)=null,--/证件类型
	@apmEmail nvarchar(50)=null,--/邮箱地址
	@apmTel	nvarchar(50)=null,--/电话号码
	@apmStart nvarchar(100)=null,--/出发地
	@apmEnd	nvarchar(100)=null,--/目的地
	@selectDate datetime=null,--/取款日期
	@selectTime nvarchar(50)=null,--/取款时间
	@selectAddress nvarchar(50)=null,--/取款地点
	@moneyType nvarchar(50)=null,--/付款方式	1 银行付款  2 柜台付款 3网上付款
	@saveIP nvarchar(50)=null,--/保存的ip
	@saveUserName nvarchar(50)=null,--/用户名
	@saveUserID nvarchar(50)=null,--/保存的用户编号	
	@state int=null,--/状态编号 -1 预约取消 0 预约 1 电话预约  2 付款确定 3 完成 4 订单取消 写入违约信息
	@stateName nvarchar(50)=null,--/状态名称
	@pathName nvarchar(50)=null,--/预约途径 网上预约 电话预约 店面预约
	@askType nvarchar(50)=null,--/配送方式
	@id int output
)
as
     begin transaction	
	declare  @moneyTypeID int
	set @moneyTypeID=convert(int,@moneyType)
	if(convert(int,@moneyTypeID)=1)
		set @moneyType='银行汇款'
	else if(convert(int,@moneyTypeID)=2)
		set @moneyType='柜台付款'	
	else if(convert(int,@moneyTypeID)=3)
		set @moneyType='网上汇款'

	declare  @selID int
	declare  @selOrderNum nvarchar(50)
	declare  @selcreateTime datetime
	declare  @selcreateName nvarchar(50)	
	
	exec hiweb_exchange_pass

	if(@updateDateIndex=0)
		begin
		        insert into zydn_ExChange(orderNum,apmName,apmCity,apmNum,apmType,apmEmail,apmTel,apmStart,
						  apmEnd,selectDate,selectTime,selectAddress,moneyType,saveDate,saveUserName,
						  saveIP,saveUserID,state,stateName,inMoney,outMoney,pathName,askType,updateDate,
						  moneyTypeID,payTab)
			values(@orderNum,@apmName,@apmCity,@apmNum,@apmType,@apmEmail,@apmTel,@apmStart,
						  @apmEnd,@selectDate,@selectTime,@selectAddress,@moneyType,getdate(),@saveUserName,
						  @saveIP,@saveUserID,@state,@stateName,0,0,@pathName,@askType,getdate(),
						  @moneyTypeID,0)
		
			if(@@error<>0)
			rollback transaction

			set @id=@@identity
			
			insert into zydn_ExChangeIndex(exID,orderNum,state,stateName,createDate,createIP,createUser,createUserID,orderCreateTime,orderCreateName)
			values(@id,@orderNum,0,'已预约',getdate(),@saveIP,@saveUserName,@saveUserID,getdate(),@apmName)
			if(@@error<>0)
			rollback transaction
		end
	   else
	        begin
			
		        update zydn_ExChange 
			set apmName=@apmName,apmCity=@apmCity,apmNum=@apmNum,apmType=@apmType,apmEmail=@apmEmail,
			    apmTel=@apmTel,apmStart=@apmStart,apmEnd=@apmEnd,selectDate=@selectDate,selectTime=@selectTime,
			    selectAddress=@selectAddress,moneyType=@moneyType,updateDate=getdate(),state=@state,stateName=@stateName,
			    askType=@askType,inMoney=0,outMoney=0,moneyTypeID=@moneyTypeID
			where [id]=@updateDateIndex
			
			if(@@error<>0)
			rollback transaction

			set @id=@updateDateIndex

			delete from zydn_ExChangeMoney where exID=@updateDateIndex and orderNum=@orderNum
		end
	
	if(@state>0)
	begin
		declare @dt datetime
		declare @user nvarchar(50)
		select @dt=saveDate,@user=apmName from zydn_ExChange where id=@id

        	insert into zydn_ExChangeIndex(exID,orderNum,state,stateName,createDate,createIP,createUser,createUserID,orderCreateTime,orderCreateName)
		values(@id,@orderNum,@state,@stateName,getdate(),@saveIP,@saveUserName,@saveUserID,@dt,@user)
		if(@@error<>0)
		rollback transaction
	end	
	select @id	
	commit transaction	



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_BSZN] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_BSZN] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_BSZN] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_BSZN] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_BSZN] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_CJ] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_CJ] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_CJ] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_GZCX] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_GZCX] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_GZCX] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_IMAGE] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_IMAGE] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_IMAGE] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_LY] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_LY] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_LY] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_LY] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_LY] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_MAIL] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_MAIL] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_MAIL] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_MAIL] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_MAIL] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_Music] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_Music] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_Music] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_Music] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_Music] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_News] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_News] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_News] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_RLZY] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_RLZY] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_RLZY] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_RLZY] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_RLZY] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_Registration] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_Registration] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_Registration] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_Registration] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_Registration] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_Results] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_Results] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_Results] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_Results] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_Results] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_SGSZ] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_SGSZ] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_SGSZ] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_SGSZ] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_SGSZ] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_Survey] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_Survey] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_Survey] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_Survey] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_Survey] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_USERPHOTO] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_USERPHOTO] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_USERPHOTO] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_USERPHOTO] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_USERPHOTO] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_articledown] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_articledown] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_articledown] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_articledown] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_articledown] 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 ON 
GO















CREATE PROCEDURE [hiweb_ExtabModi_tab_csArticle] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser nvarchar(250) =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_csArticle] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_csArticle] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_csArticle] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_csArticle] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_diary] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_diary] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_diary] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_groupDay] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_groupDay] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_groupDay] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_groupDay] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_groupDay] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_groupMusic] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_groupMusic] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_groupMusic] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_groupMusic] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_groupMusic] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_groupPhoto] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_groupPhoto] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_groupPhoto] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_groupPhoto] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_groupPhoto] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_lgq] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_lgq] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_lgq] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_lgq] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_lgq] 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 ON 
GO















CREATE PROCEDURE [hiweb_ExtabModi_tab_mobileNews] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser nvarchar(250) =null  ,
@fid int =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_mobileNews] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  update [tab_mobileNews] set   menuid=@menuid,menuName=@menuName,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,[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_mobileNews] 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 ON 
GO















CREATE PROCEDURE [hiweb_ExtabModi_tab_moblieNews] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser nvarchar(250) =null  ,
@fid int =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_moblieNews] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  update [tab_moblieNews] set   menuid=@menuid,menuName=@menuName,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,[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_moblieNews] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_note] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_note] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_note] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_note] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_note] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_pepole] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_pepole] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_pepole] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_pepole] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_pepole] 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 ON 
GO















CREATE PROCEDURE [hiweb_ExtabModi_tab_psArticles] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser nvarchar(250) =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_psArticles] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_psArticles] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_psArticles] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_psArticles] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_sAndD] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_sAndD] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_sAndD] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_sAndD] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_sAndD] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_shop] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_shop] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_shop] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_soft] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_soft] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_soft] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_softdown] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_softdown] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_softdown] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO
SET ANSI_NULLS ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_transaction] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_transaction] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_transaction] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_transaction] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_transaction] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_userMusic] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_userMusic] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_userMusic] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_userMusic] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_userMusic] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_userday] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_userday] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_userday] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_userday] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_userday] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_video] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_video] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_video] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_webService] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_webService] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_webService] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_webService] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_webService] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_webUrl] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_webUrl] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_webUrl] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_webUrl] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_webUrl] 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 ON 
GO

CREATE PROCEDURE [hiweb_ExtabModi_tab_xyl] 
@title nvarchar (250) =null,
@content ntext =null  ,
@saveUser nvarchar(50) =null  ,
@saveUserID nvarchar(50) =null  , 
@saveUserIP nvarchar(50) =null  ,
@IPaddress   nvarchar(200)=null, 
@CBS nvarchar(250) =null  ,
@Kind nvarchar(50) =null,
@TabKeys nvarchar(250) =null  ,
@TabImage nvarchar(250) =null  ,
@WebUrl nvarchar(250) =null  ,
@IsTop int =null  ,
@IsEssence int =null  ,
@Examine int =null  ,
@IsHidden int =null  ,
@IsRemark int =null,
@ArtID int =null  ,
@pID int =null  ,
@inquiry nvarchar(100) =null  ,
@Source nvarchar(50) =null  ,
@SourceUrl nvarchar(250) =null  ,
@signFor int =null  ,
@signForUser ntext =null  ,
@fid int =null,
@saveDate dateTime =null,
@menuid int =null,
@id int =null output 
 AS
/* 修改条记录的基本数据*/
Declare @menuName nvarchar(100)
select @menuName=mName from zydn_menu where mid =@menuid
if(@fid is null)   
    INSERT INTO [tab_xyl] ([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,[menuid],[menuName])  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,@menuid,@menuName) 
else  
  BEGIN  
	  if ( @saveDate is null)
		 BEGIN 
		  update [tab_xyl] set   menuid=@menuid,menuName=@menuName,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,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
	 else 
		 BEGIN 
		  update [tab_xyl] set   menuid=@menuid,menuName=@menuName,title=@title,content=@content,saveUserIP=@saveUserIP,saveDate=@saveDate,cbs=@CBS,[Kind]=@Kind,[TabKeys]=@TabKeys,[TabImage]=@Tabimage,[WebUrl]=@WebUrl,[IsTop]=@isTop,[IsEssence]=@IsEssence,[Examine]=@Examine,[IsHidden]=@IsHidden,[P_A_View_ID]=@pID,[inquiry]=@inquiry,[Source]=@Source,[SourceUrl]=@SourceUrl,[signFor]=@signFor,[signForUser]=@signForUser,IsRemark=@IsRemark where id=@fid   
		 END
                   


  END


if (@fid is null) 
	BEGIN
		 select top 1 @id=id from [tab_xyl] 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_Favrite] 
@fType int =null,
@menuid int =null,
@tab nvarchar(50)=null,
@tabid int=null,
@userid int =null,
@vText nvarchar(150)=null,
@uname nvarchar(50)=null
AS
if (@fType=1) 
	BEGIN
		delete  zydn_Favorite where uid=@userid and tabId=@menuid  and fType=@fType
		insert into zydn_Favorite (vText,tabId,uid,uname,fType,createDate) values(@vText,@menuid,@userid,@uname,@fType,getDate())
	END
else
	BEGIN
		delete  zydn_Favorite where uid=@userid and tabId=@tabid and tabName=@tab and fType=@fType
		insert into zydn_Favorite (vText,tabId,uid,uname,tabName,fType,createDate) values(@vText,@tabid,@userid,@uname,@tab,@fType,getDate())
	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  nvarchar(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 nvarchar(250)
Declare @newUPID  nvarchar(250)
Declare @inLayer int
Declare @newLayer int
Declare @Layer  int
Declare @isDown int
Declare @UpList nvarchar(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 nvarchar(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 )
	BEGIN
		update zydn_menu set isDown=0 where mid=@menuid
	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_SaveOption]
@sindex int =null,
@name nvarchar(50)=null,
@text nvarchar(50)=null,
@value nvarchar(50)=null,
@downText nvarchar(1000)=null,
@sType int=null,
@isClear int =null,
@dataType int =null,
@menuName nvarchar(150)=null,
@menuID int =null,
@menuTab nvarchar(150)=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,menuid,tabName,menuName,dataType) 
		values
		(@name,@text,@value,@downText,@maxid,@sType,0,@menuID,@menuTab,@menuName,@dataType)
set @outindex=@maxid


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO












CREATE PROCEDURE [hiweb_SavePower]
@MPName nvarchar(50) =null,
@MPType int =null,
@P_A_View_G nvarchar(600)=null,
@P_A_View_U nvarchar(500)=null,
@P_A_Add_G nvarchar(600)=null,
@P_A_Add_U nvarchar(500)=null,
@P_A_Edit_G nvarchar(600)=null,
@P_A_Edit_U nvarchar(600)=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(600)=null,
@P_C_View_U nvarchar(500)=null,
@P_C_Add_G nvarchar(600)=null,
@P_C_Add_U nvarchar(500)=null,
@P_C_manage nvarchar(200)=null,
@IsDefault int =null,
@P_A_SignFor_G nvarchar(600)=null,
@P_A_SignFor_U nvarchar(500)=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,
	P_A_SignFor_U,
	P_A_SignFor_G
	 )
	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,
	@P_A_SignFor_U,
	@P_A_SignFor_G
	)
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,
	P_A_SignFor_U=@P_A_SignFor_U,
	P_A_SignFor_G=@P_A_SignFor_G
	
	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_SaveTabInt]  
@userID int =null,
@userName nvarchar(250) =null,
@dispInt int= null,
@dispMoney int =null,
@AwardsInt int =null,
@AwardsMoney int =null,
@tabid  int =null,
@tabName nvarchar(100) =null,
@outID int = null  output
AS
set @outID=-1
select @outID=id from zydn_tabInt where tabid=@tabid and tabName=@tabName
if @outID=-1
	BEGIN
		insert into [zydn_tabInt] (
		tabid,tabName,saveUser,saveUserID,dispInt,dispMoney,AwardsInt,AwardsMoney
		) values(
		@tabid,@tabName,@userName,@userID,@dispInt,@dispMoney,@AwardsInt,@AwardsMoney
		)
		select @outID=max(id) from zydn_tabInt
		update zydn_User_Base set  Integral_Base=Integral_Base-@AwardsInt,[Money]=[Money]-@AwardsMoney where id=@userID
	END
else
 	Begin
/*		UPDATE zydn_tabInt set dispInt=@dispInt,dispMoney=@dispMoney,AwardsInt=@AwardsInt,AwardsMoney=@AwardsMoney where tabid=@tabid and tabName=@tabName */
		UPDATE zydn_tabInt set dispInt=@dispInt,dispMoney=@dispMoney where tabid=@tabid and tabName=@tabName 
	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_SaveVot] 
@title nvarchar(1000) =null,
@optionName nvarchar(1000) =null,
@countNum nvarchar(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 ON 
GO
SET ANSI_NULLS OFF 
GO









CREATE PROCEDURE [hiweb_SignFor] 
@tab nvarchar(200)=null,
@tabid int =null,
@toUser nvarchar(200)=null,
@text nvarchar(250)=null,
@ip nvarchar(50)
AS
update  [zydn_signFor] set 
	state=1,
	leaveWord=@text,
	signForDate=getDate(),
	ip=@ip 
 where  tabid=@tabid  and  tab=@tab  and toUser=@toUser

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_TenderSave
@out int output,
@userID int,
@userName nvarchar(50),
@planID int,
@mark nvarchar(1000),
@path nvarchar(200)=null,
@tInt int,
@tMoney int,
@tenderIP nvarchar(50),
@tenderAddress nvarchar(250)
as
declare @isExist int
select @isExist=count(0) from zydn_tender where userID=@userID and planID=@planID
if(@isExist>0)
	begin
		set @out = 0
	end
else
	begin
		--declare @usertInt int, @usertMoney int
		--select @usertInt=Integral_Base,@usertMoney=Money from zydn_User_Base where ID=@userID
		--update zydn_User_Base set Integral_Base=@usertInt-@tInt,Money=@usertMoney-@tMoney where ID=@userID
		insert into zydn_tender(userID,userName,planID,mark,path,tenderIP,tenderAddress,tenderTime) values(@userID,@userName,@planID,@mark,@path,@tenderIP,@tenderAddress,getdate())
		set @out = @@identity
	end





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





CREATE proc hiweb_UpdateGoodBad
(
@tab nvarchar(100)=null,
@tabid int=null,
@typeid int
)
as

begin 

 declare @res nvarchar
 declare @sql nvarchar(3000)
 declare @tj nvarchar(50)
 if(@typeid=1)
 begin 
	  set @sql='update '+@tab+' set Point_Good=0 where  Point_Good is null and  id='+Convert(nvarchar(50),@tabid);
 end
  else
 begin
	 set @sql='update '+@tab+' set Point_Bad=0  where  Point_Bad is null and  id='+Convert(nvarchar(50),@tabid);
 end

exec(@sql)


if(@typeid=1)
 begin 
 	 set @sql='update '+@tab+' set Point_Good=Point_Good+1 where id='+Convert(nvarchar(50),@tabid);
 end
  else
 begin
  	set @sql='update '+@tab+' set Point_Bad=Point_Bad+1  where id='+Convert(nvarchar(50),@tabid); 
 end
	 
 exec(@sql)

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_UserDelInt]   /*对用户作加减积分 和虚拟货币操作, 并保存到操作记录*/
   @intNum  int =null,
   @moneyNum int = null,
   @userID int =null,
   @tab   nvarchar(250) = null,
   @tabid int =null,
   @userName nvarchar(100) =null,
   @isInt int =null output
 AS
Declare @title  nvarchar(250)
Declare @uInt int 
Declare @uMoney int 
set @isInt=1
select  @uInt=Integral_Base,@uMoney =[money] from [zydn_User_Base] where id = @userID
if (@uInt + @intNum < 0 or @uMoney + @moneyNum<0) 
    BEGIN
	set @isInt=0
    END 
else
	BEGIN
		if (@tab <>null and @tabid <>null)
		BEGIN
			select @title  =title from  zydn_room where  tabname=@tab and tabid =@tabid
		END
		update  [zydn_User_Base]  set  Integral_Base=Integral_Base+@intNum, [Money]=[Money]+@moneyNum where id=@userID
		insert    into [zydn_useInt](userName,userID,intNum,moneyNum,createDate,title,tab,tabid)
				values (@userName,@userID,@intNum,@moneyNum,getDate(),@title,@tab,@tabid)
	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_addBunch] 
@bid int =null,
@uid int =null,
@IP varchar(50),
@isMain int =null,
@isHave int =null,
@isAdd int =null output
AS

Declare  @countID  int 
select @countID=count(0) from [zydn_bunchUser]  where  userid=@uid and bunchid=@bid
if (@countID>0)
  BEGIN  
	set @isAdd=2
  END
else 
  BEGIN  
	Declare @uName nvarchar(100)
	Declare @bName nvarchar(100)

	select @uName=userName from [zydn_User_Base] where id =@uid
	select @bName= bunchName from [zydn_bunchBase] where id=@bid
	if (@uName is null   or @bName is null)
	BEGIN
		set @isAdd=0
	END
	else
	BEGIN
		
		insert into zydn_bunchUser ( userid,userName,bunchid,bunchName,jdate,jip,isMain,isHave  )
		values(@uid,@uName,@bid,@bName,getDate(),@IP,@isMain,@isHave)
		set @isAdd=1
	END
  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_addFriend] 
@myID  int =null,
@fID int =null,
@isAdd int =null output
AS


Declare @myName  nvarchar(100)
Declare @fName nvarchar(100)
Declare @fCount int
select @fCount=count(0) from zydn_friend where userid=@myID and fuserid =@fID

if (@fCount>0) 
	BEGIN
		set @isAdd=2
	END
else
	BEGIN
		select @myName=UserName from zydn_User_Base where id=@myID
		select @fName=UserName from zydn_User_Base where id=@fID
		
		if (@myName is not null and @fName is not null) 
			BEGIN
				insert into zydn_friend  (userid,userName,fuserid,fuserName,jdate) values(@myID,@myName,@fID,@fName,getDate()  )
				set @isAdd=1
			END
		else
			BEGIN
				set @isAdd=0
			END
	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_addUser(
	@userName nvarchar(50)=null,
	@userPass nvarchar(50)=null,
	@Email nvarchar(100) =null,
	@Mobile nvarchar(20)=null,
	@passQuestion nvarchar(50)=null,
	@passAnswer nvarchar(250)=null,
	@idiograph nvarchar(250)=null,
	@aUser nvarchar(50)=null,
	@userPhoto nvarchar(200)=null,
	@gId int=0,
	@aid int=null,
	@uid  int =null output,
	@outInfo int =null output,
	@IsExamine int =null
)
AS
begin
	declare  @isEof int	
	declare  @gName nvarchar(100)
	declare  @Lname nvarchar(100)
	declare  @Lid int
	set  @Lname=null
	set @Lid=null 
	if (@IsExamine=null)
		set @IsExamine=1

  	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 (@gId<>0) 
		select @gName=[GroupName],@gid=[id] from [zydn_UserGroup] where [id]=@gid			
		
  	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,@IsExamine,@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
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_changeMidKey
@outNum int output, 
@payMid nvarchar(100),
@payKey nvarchar(100)
AS
declare @count int 
select @count=count(0) from zydn_Shop_MidKey
if(@count>0)
begin
	update zydn_Shop_MidKey set payMid = @payMid,payKey = @payKey
	set @outNum=@@identity
end
else
	insert into zydn_Shop_MidKey(payMid,payKey) values(@payMid,@payKey)
	set @outNum=@@identity





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_changeMoney
@tid int,
@tInt int,
@tMoney int
as
declare @usertInt int, @usertMoney int,@uid int
select @uid=userID from zydn_tender where id=@tid
select @usertInt=Integral_Base,@usertMoney=Money from zydn_User_Base where ID=@uid
update zydn_User_Base set Integral_Base=@usertInt+@tInt,Money=@usertMoney+@tMoney where ID=@uid
update zydn_tender set isPay=1 where id=@tid





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




/*----------------更改订单数量------------------*/
CREATE proc hiweb_changeMyCart	
	@newNum int=0,/*--------------------新的订单数量-------*/
	@ID int=0,/*------------------------订单表的编号-------*/
	@UserID int=0, /*-------------------用户编号-----------*/
	@allTotal numeric(10,2)=0 output/*--总价格---(-1 商品不存在 0库存量不足)----------*/
as
	begin
		declare @tabName nvarchar(50)/*----商品表名称----------*/
		declare @tabid int/*---------------商品所在商品表编号---*/
		declare @sql nvarchar(2000)/*------定义一个查询---------*/		
		declare @price numeric(10,2)/*-----商品价格------------*/
		declare @CommodityName nvarchar(100)/*---商品名称------*/
		select @tabName=TabName,@tabid=TabID,@price=Price from zydn_OrderList where [id]=@ID
		if(@tabName is not null and @tabid is not null)
			begin
				declare @num int
				declare @count int
				set @sql='select @count=count(0) from syscolumns  where id=object_id('''+@tabName+''') and name=''shopStock'''
				exec sp_executesql @sql,N'@count int output',@count output
				if(@count=0)
					begin
						set @sql='alter table '+@tabName+' add shopStock int'
						exec(@sql)
						set @sql='update '+@tabName+' set shopStock=1'
						exec(@sql)
	
						update zydn_OrderList set CommodityNum=1,Total=@price where [id]=@ID
						set @allTotal=-1				
						
					end	
				else
					begin
						set @sql='select @num=shopStock,@CommodityName=title from '+@tabName+' where id='+convert(varchar(50),@tabid)
						exec sp_executesql @sql,N'@num int output,@CommodityName nvarchar(100) output',@num output,@CommodityName output
						if(@num<@newNum)
							begin
								update zydn_OrderList set CommodityNum=@num,Total=@num*@price,CommodityName=@CommodityName where [id]=@ID
	
								set @allTotal=-@num
							end
						else
							begin					
								update zydn_OrderList set CommodityNum=@newNum,Total=@newNum*@price,CommodityName=@CommodityName where [id]=@ID
									
								set @allTotal=@newNum*@price
							end
					end
			end
		else
			begin
				delete from zydn_OrderList where [id]=@ID
				set @allTotal=0
			end
	end


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO









create proc hiweb_checkIsDel
@planID int,
@outNum int output
as
declare @count int
select @count=count(0) from zydn_setPlan where mid=@planID
if(@count>0)
begin
	set @outNum = 0
end
else
begin
	set @outNum = 1
end





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO









create proc hiweb_checkUser
@planID int,
@userID int,
@outNum int output
as
declare @flag int
select @flag=count(0) from zydn_setPlan where mid=@planID and userID=@userID
if(@flag>0)
begin
	set @outNum = 0
end
else
begin
	set @outNum = 1
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_clearTable]
@tabname nvarchar(50)=null
 AS
Declare @sql nvarchar(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
delete  [zydn_tabInt] where tabName=@tabname
delete  [zydn_useInt] where tab=@tabname





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO









CREATE PROCEDURE [hiweb_clearlFile]
@id int =null
 AS
Declare @fileid  int
Declare @table nvarchar(100) 
Declare @count int
Declare @sql nvarchar(1000)
Declare @userName nvarchar(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 nvarchar(50))+' '
		   execute (@sql)
		delete zydn_review where ATab=@table  and AID =@fileid
		delete  [zydn_contribute] where tabName=@table and tabId=@fileid
		delete  [zydn_tabInt] where tabName=@table and tabId=@fileid
		delete  [zydn_useInt] where tab=@table
	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 nvarchar(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  nvarchar(100) =null,
@mid  int =null,
@mName nvarchar(100) =null,
@uID	int	=null,
@uName	nvarchar(50)=null,
@uGroup	nvarchar(100)=null,
@uGroupID	nvarchar(10)=null,
@Examine	int =null,
@tabName nvarchar(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,createDate
)
 values
(
	@title,@mid,@mName,@uID,@uName,@uGroup,@uGroupID,@Examine,@tabName,@tabId,getdate()
)





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO





CREATE PROCEDURE [hiweb_createBunch] 

@bName nvarchar(250)=null,
@uID  int =null,
@uName nvarchar(250)=null,
@bPhoto nvarchar(500)=null,
@bNote nvarchar(500),
@cIP varchar(50),
@isC int =null output,
@newID int =null output
AS
Declare  @bCount int 
select  @bCount = count(0) from [zydn_bunchBase] where bunchName=@bName and cuserid=@uID
if (@bCount   >0)
	BEGIN
		set @isC=-2
	END
else
	BEGIN
		insert into [zydn_bunchBase] (bunchName,cuserid,cuserName,cip,cdate,isDel,note,bunchPhoto,homeClickCount)
			values (@bName,@uID,@uName,@cIP,getDate(),0,@bNote,@bPhoto,0)
		select  top 1@newID=id from [zydn_bunchBase]  where cuserid=@uID order by id desc

		set @isC=-1
	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_createLabelIco]
@url nvarchar(200)=null,
@pName nvarchar(100) =null,
@lName nvarchar(100)=null,
@userid int =null,
@userName nvarchar(100) =null,
@isCreate int=null output
 AS
Declare  @count int 
Declare  @x int
Declare  @y int
set @count=0
select @count=count(0) from [zydn_Program] where pName=@pName
if @count=0
	BEGIN
		set  @isCreate=1
		insert into [zydn_Program] (pName,isPop,pAsName,windowType,Width,Height,ICO,Path,isSys,isDeskTop)
				   values  (@pName,1,@lName,0,650,460,'ico/modiLabel.gif',@url,0,1)
		select @x=max(x) from [zydn_Desktop]
		select @y=max(y) from [zydn_Desktop]
		set @y=@y-50
		set @x=@x+50
		
	        insert into [zydn_Desktop](pName,x,y,userID,userName)values(@pName,@x,@y,@userid,@userName)
	END
else
	BEGIN
		set @isCreate=-1
		
	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_createMenu] 
@menuName nvarchar (255) =null,
@rid nvarchar(255) =null  output ,
@menuid int =null,
@idList nvarchar(255) =null  ,
@layer int=null,
@isTop int =null,
@menuText nvarchar(500)=null,
@menuIndex int=null,
@menuAffiche nvarchar(2800)=null,
@menuKey nvarchar(255) =null,
@asTab nvarchar(255) =null,
@menuIntro nvarchar(255)=null,
@powerid int =null,
@userInt nvarchar(100)=null,
@isNavigation int =null,
@isMenu int =null, 
@isHidden int =null,
@isReview int =null, 
@isHTML int =null,
@menuType int =null ,
@PageUrl nvarchar(255)=null, 
@templet nvarchar(255)=null,
@pageSize int =null,
@isHomePage int =null,
@isListFile int =null,
@TitleImg nvarchar(255) =null,
@isfind int =null,
@isChildHome int =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,
	isTop,
	isFind,
	isChildHome
	) 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,
	@isTop,
	@isfind,
	@isChildHome
	)
   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,
	isTop,
	isChildHome
	) 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,
	@isTop,
	@isChildHome
	)
   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 nvarchar(50)=null,
@isclear int =null,
@title nvarchar(200)=null,
@saveUser nvarchar(100)=null,
@cbs nvarchar(500)=null,
@saveDate datetime =null,
@Examine tinyint =null
AS
  declare @sql nvarchar(1000)
  declare @roomId int
  if (@saveDate is null)
	set @saveDate=getdate()

  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],[Examine]) values (@menuid,@tabid,@table,@title,@cbs,@saveUser,@saveDate,0,@Examine)

   set @roomId=@@identity
   
   set @sql='update zydn_room set saveUser=(select SaveUser from '+@table+' where id='+convert(varchar(50),@tabid)+') where id='+convert(varchar(50),@roomId)
   exec(@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_delBbsMain]
/*删除论坛主题*/
@mid int =null,
@menuid int=null  output,
@userid int =null output
 AS
begin transaction
        declare @re int
	select  @menuid=menuid, @userid=saveUserID from   [zydn_BBSMain]   where id=@mid
	update   [zydn_BBSMain] set  isdel=1 where id=@mid
        if @@error<>0
	rollback transaction    
	select @re=count(id) from zydn_BBSRe where mainID=@mid

        update [zydn_BBSRe] set isdel=1 where mainID=@mid
        if @@error<>0
        rollback transaction	
        update [zydn_Menu] set bbsTitleCount=bbsTitleCount-1 where MID=@menuid
        if @@error<>0
        rollback transaction	
        update [zydn_Menu] set bbsReCount=bbsReCount-@re where MID=@menuid
	if @@error<>0
        rollback transaction	
commit transaction




GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO











CREATE PROCEDURE [hiweb_delBbsRe]
@id int =null,
@menuid int=null  output,
@userid int =null output
 AS
/*删除回复的贴子*/
begin transaction
declare @mainID int
select  @menuid=menuid, @userid=saveUserID,@mainID=mainID from   [zydn_BBSRe]   where id=@id

update [zydn_BBSRe] set isDel=1 where id=@id
if @@error<>0
rollback transaction
update [zydn_BBSMain] set reCount=reCount-1 where id=@mainID
if @@error<>0
rollback transaction
update [zydn_Menu] set bbsReCount=bbsReCount-1 where MID=@menuid
if @@error<>0
rollback transaction

commit transaction





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO





CREATE PROCEDURE [hiweb_delBunch]
@uid     int =null,
@bid int=null,
@outStr int =null output
 AS

delete    zydn_bunchBase   where  [id]=@bid and   cuserid=@uid
if  (@@ROWCOUNT=1)
	BEGIN
	    delete   zydn_bunchUser  where  bunchid=@bid
	    set @outStr=1
	END 
else
	BEGIN
		set @outStr=0
	END


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





CREATE proc hiweb_delExChange
(
	@id int=null,
	@orderNum nvarchar(50)=null
)
as
begin transaction

	delete from zydn_ExChange where id=@id and orderNum=@orderNum and state=-1
	if(@@error<>0)
	rollback transaction

	delete from zydn_ExChangeIndex where exID=@id and orderNum=@orderNum
	if(@@error<>0)
	rollback transaction


	delete from zydn_ExChangeMoney where exID=@id and orderNum=@orderNum
	if(@@error<>0)
	rollback transaction
commit transaction



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





CREATE proc hiweb_delExChangeItem
(
	@id int
)
as
begin transaction
	
	declare @exID int
	declare @runMoney float
	declare @rate float	
	declare @type nvarchar(50)

	select @exID=exID,@runMoney=runMoney,@type=type,@rate=Rate from zydn_ExChangeMoney where id=@id

	if(@type='Out')
		begin
			update zydn_ExChange set outMoney=outMoney-@runMoney-@rate where id=@exID
			if(@@error<>0)
			rollback transaction
		end
	else		
		begin
			update zydn_ExChange set inMoney=inMoney-@runMoney+@rate where id=@exID
			if(@@error<>0)
			rollback transaction
		end
	delete from zydn_ExChangeMoney where id=@id
		if(@@error<>0)
		rollback transaction	
	
commit transaction


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 nvarchar(200) =null,
@tabid nvarchar(1000)=null
 AS
Declare @sql nvarchar(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 nvarchar(1000)=null,
@table nvarchar(50) =null,
@menuid int =null
AS
/*用于删除文件*/
Declare @sql  nvarchar(2000) 
set @sql='update    zydn_room set isDel=1,delDate=getDate() where tabname='''+@table+''' and mid='+CAST(@menuid as nvarchar(50)) +' and tabid in ('+@fileidList+')  '
execute (@sql)
set @sql='update    ['+@table+'] set isDel=1  where  id in ('+@fileidList+')  '
execute (@sql)

set @sql=' update ['+@table+']   set upid=null, downid=null ,downRecord=null,upRecord=null  where  upid  in ('+@fileidList+' ) or  downid 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





CREATE PROCEDURE [hiweb_delFriend]
@uID int =null,
@ID int=null,
@outStr int =null output
 AS

delete zydn_friend where   userid=@uID  and id=@id

set @outStr=@@ROWCOUNT


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 nvarchar(50))+',',   CAST(@defid  as  nvarchar(50))+','   ) where GroupID like '%'+CAST(@groupid as nvarchar(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_delIntpuFile]
@menuid  int =null,
@table varchar(250) =null,
@title nvarchar(800)=null

 AS
Declare @tabid   int
Declare @id  int
Declare @sql nvarchar(800)



select   @tabid=tabid , @id=id   from zydn_room where  [mid]=@menuid  and [tabname]=@table  and [title]=@title

delete zydn_room where id=@id

set @sql='   delete from  '+@table+' where id='+CAST(@tabid as nvarchar(50))+' '
execute (@sql)

delete zydn_review where ATab=@table  and AID =@tabid
delete  [zydn_contribute] where tabName=@table and tabId=@tabid
delete  [zydn_tabInt] where tabName=@table and tabId=@tabid



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 nvarchar(50) =null ,
@upidList nvarchar(100) =null ,
@idList nvarchar(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 nvarchar(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 ON 
GO









create proc hiweb_delMyCartItem
@allTotal numeric(10,2) output,
@ID int,
@UserID int 
as
	delete zydn_OrderList where ID=@ID
	select @allTotal=sum(Total) from zydn_OrderList where userID=@UserID and isCart=1





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO






-------/删除一条数据-----------
CREATE proc hiweb_delOneDate
(
 @tab nvarchar(100)=null,
 @tabid int=null
)
as
 begin transaction 
   
   declare  @nowtab nvarchar(3000)
   set @nowtab='delete from  '+@tab+' where [id]='+convert(nvarchar(50),@tabid)
   
  ------------/删除主表中的数据--------
   exec (@nowtab)
   if @@error<>0
   rollback transaction
   ------------/删除room表中的数据---------    
   delete from zydn_room where tabid=@tabid and tabname=@tab
   if @@error<>0
   rollback transaction
   
   -------------/删除回复表中的数据------------

   delete from zydn_review where AID=@tabid and ATab=@tab
   if @@error<>0
   rollback transaction

   commit transaction
 


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 nvarchar(1000)=null
 AS
Declare @sql nvarchar(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 ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_delTender
@isTender int,
@userID int,
@planID int,
@tInt int,
@tMoney int
as
	delete zydn_tender where planID=@planID
	delete zydn_setPlan where mid=@planID
	delete zydn_tabInt where id=@isTender
	update tab_News set Art_View_Int_ID=-1 where Art_View_Int_ID=@isTender
	update  [zydn_User_Base] set Integral_Base=Integral_Base+@tInt, [Money]=[Money]+@tMoney where ID=@userID





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 nvarchar(50)=null output,
@filePath nvarchar(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 nvarchar(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 OFF 
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,
		zydn_Config_Field.fEditType,
		zydn_Config_Field.isList 

		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,zydn_Config_Field.fEditType
	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,
	zydn_Config_Field.fEditType,
	zydn_Config_Field.isFind 
	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 ON 
GO
SET ANSI_NULLS ON 
GO




/*--------------当前存储过程是回收过期的预约单-------------------*/
CREATE proc hiweb_exchange_pass
as
	begin transaction
		update zydn_ExChange set payTab=0 where payTab is null 
		if @@error<>0
		rollback transaction	
		
		declare  @selID int
		declare  @selOrderNum nvarchar(50)
		declare  @selcreateTime datetime
		declare  @selcreateName nvarchar(50)		
		declare cur_name cursor for		
		select id,orderNum,saveDate,apmName from zydn_ExChange where datediff(hh,updateDate,getdate())>12 and state=1 and payTab=0
		open cur_name 
		fetch next from cur_name into @selID,@selOrderNum,@selcreateTime,@selcreateName
		while(@@fetch_status = 0) 
		begin 
			insert into zydn_ExChangeIndex(exID,state,stateName,createDate,createUser,remark,orderNum,orderCreateTime,orderCreateName)
			values(@selID,-1,'预约取消',getdate(),'系统自动取消','系统自动取消大于12小时未付款成功的预约单',@selOrderNum,@selcreateTime,@selcreateName)
			if @@error<>0
			rollback transaction
			
			update zydn_ExChange set state=-1,stateName='预约取消' where datediff(hh,saveDate,getdate())>12 and state=1 and payTab=0 and id=@selID
			if @@error<>0
			rollback transaction			

			fetch next from cur_name into  @selID,@selOrderNum,@selcreateTime,@selcreateName
		end 
		close cur_name 
		deallocate cur_name 

		update zydn_ExChange set payTab=0 where payTab is null
		if @@error<>0
		rollback transaction	
	commit transaction


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 nvarchar(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 ON 
GO









create proc hiweb_hasCart
@orderID nvarchar(50) output,
@userID int
as
select @orderID=OrderID from zydn_orderList where userID=@userID and isCart=1





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO







CREATE proc hiweb_inputBBS
(
  @title nvarchar(100),------------/发帖标题
  @content ntext,
  @saveUser nvarchar(50),-------/发帖人名称
  @saveDate datetime,---/发帖时间
  @saveUserID int,-------/发帖人的ID               
  @reUser nvarchar(50),---------/回帖人名称
  @reDate datetime,---------/回帖的时间
  @reUserID int,---------/回帖人的ID               
  @isTop tinyint,---------/是否置顶              
  @locked tinyint,---------/锁定状态              
  @clickCount int,---------/点击次数
  @menuid int,---------/栏目编号 
  @isDel tinyint,---------/是否删除
  @id int output
)
as
begin
 insert into zydn_BBSMain(title,content,saveUser,saveDate,saveUserID,reUser,reDate,reUserID,isTop,locked,clickCount,menuid,isDel,postType,reID,outInt,inInt,isReDisplay,isElite,reCount,vote)
	values(@title,@content,@saveUser,@saveDate,@saveUserID,@reUser,@reDate,@reUserID,@isTop,@locked,@clickCount,@menuid,@isDel,'0',0,0,0,'0','0',0,0)
 select @id=@@identity
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_int2add]
@intstr  numeric =null,
@add nvarchar(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 ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_isTender
@planID int,
@outNum int output
as
declare @flag int
select @flag=count(0) from zydn_tender where isOK=1 and planID=@planID
if(@flag>0)
begin
	set @outNum = 1
end
else
begin
	set @outNum = 0
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_lockedBbsPost] 
/*锁定贴子*/
@id int =null,
@menuid int =null output,
@userid int=null output
AS

  select @menuid=menuid, @userid=saveUserID from  zydn_BBSMain  where id=@id
  update zydn_BBSMain set locked=1 where id=@id




GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO





CREATE PROCEDURE [hiweb_logOutBunch]
@bid  int =null,
@uid int=null,
@outStr int =null output
 AS


delete  zydn_bunchUser where   userid=@uid  and bunchid=@bid  and isMain=0

set @outStr=@@ROWCOUNT


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO









/* 
修改一个栏目的属性
*/
CREATE  PROCEDURE [hiweb_modiMenu] 
@menuName nvarchar (255) =null,
@menuid int =null,
@menuText nvarchar(500)=null,
@menuIndex int=null,
@menuAffiche nvarchar(2800)=null,
@menuKey nvarchar(255) =null,
@asTab nvarchar(255) =null,
@powerid int =null,
@userInt nvarchar(100)=null,
@setDownMenu int =null,
@menuIntro  nvarchar(255)=null,
@isNavigation int =null,
@isMenu int =null, 
@isHidden int =null,
@isReview int =null, 
@isHTML int =null,
@menuType int =null ,
@PageUrl nvarchar(255)=null, 
@templet nvarchar(255)=null,
@setDownMenuInt int =null,
@pageSize int =null,
@isHomePage int =null,
@isListFile int =null,
@TitleImg nvarchar(255) = null,
@isTop int =null,
@isFind int =null,
@isChildHome int =null
 AS
	if (@pageSize <=0) 
	BEGIN
		set @pageSize=1
	END
	Declare @upPower  nvarchar(250)
	Declare @upList   nvarchar(250)
	Declare @layer  int 
	Declare @isDown int
	Declare @sql nvarchar(1000)
	
	select @upList = UpListID, @layer=layer,@upPower=UsePower,@isDown =isDown    from zydn_menu where mid =@menuid
      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,
	isTop=@isTop,
	isFind=@isFind,
	isChildHome=@isChildHome
	 where mid=@menuid
if (@isDown = 1)
	BEGIN
	             if (@setDownMenu=1)
		BEGIN
			update zydn_menu  set usePower=@powerid   where  UpListID like  @upList +',%'
		END 
	else
		BEGIN
			if (@layer>0)
			BEGIN
				set @sql='select  top 1 @upPower=UsePower from zydn_menu where mid  in ('+@upList+') and layer<'+ cast(@layer as nvarchar(50)) +'  order by mid desc'
				
				exec sp_executesql   @sql,N'@upPower   nvarchar(250)   out' ,@upPower   out   
			END
			
			update zydn_menu  set usePower=@powerid   where   UpListID like  @upList +',%' and 	UsePower=@upPower
	
		END
	END
if (@setDownMenuInt=1)
	BEGIN
		update zydn_menu  set userInt = @userInt   where  UpListID like (select UpListID from zydn_menu where mid=@menuid)+',%'
		
	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_modiTabClass] 
@tabName nvarchar (50) =null,
@tabAsName nvarchar(50) =null  ,
@displayType nvarchar(50) =null  ,
@addField nvarchar(255) =null  ,
@ContentPage nvarchar(255)=null,
@EditPage nvarchar(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 nvarchar(100) =null,
@Mobile nvarchar(20)=null,
@passQuestion nvarchar(50)=null,
@passAnswer nvarchar(250)=null,
@idiograph nvarchar(250)=null,
@userPhoto nvarchar(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 ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_orderList
@userID int = null
as
select [OrderID],[UserName],[CommodityName],[Price],[CommodityNum],[Total],[CreateTime],[OrderState]
from zydn_order





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO












CREATE proc hiweb_orderListLog
@mid int,
@userName nvarchar(50),
@userID int,
@uGroupName nvarchar(50),
@uGroupID varchar(50),
@IP varchar(50),
@oldPrice numeric(18,0),
@newPrice numeric(18,0),
@CommodityName nvarchar(50),
@orderID nvarchar(50)
AS
INSERT INTO [zydn_orderListLog]([mid], [userName], [userID], [uGroupName], [uGroupID], [IP],[changeTime], [oldPrice], [newPrice],CommodityName,orderID)
VALUES(@mid,@userName,@userID,@uGroupName,@uGroupID,@IP,getdate(),@oldPrice,@newPrice,@CommodityName,@orderID)


update zydn_OrderList set UpdateStateTime=getdate() ,Price=@newPrice where [ID]=@mid

SET QUOTED_IDENTIFIER OFF 




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 nvarchar(50) =null,
@field nvarchar(1000)=null,
@order nvarchar(100) =null,
@where nvarchar(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 nvarchar(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 nvarchar(50) =null,
@field nvarchar(1000)=null,
@order int =null,
@where nvarchar(250) =null,
@pagesize int =null,
@page int =null
 AS
/*
这是一个按ID分页的存储过程  有很高的效率
@order =0 升序  非0 降序
*/
Declare @sql  nvarchar(2000) 
Declare @pagestr int 
Declare @where1 nvarchar(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 nvarchar (50))+'  '+@field+'  FROM  '+@table
set @sql=@sql+' WHERE (ID > =    (SELECT Max(id)  from ( '
set @sql=@sql+ 'SELECT TOP '+CAST(@pagestr as nvarchar(50))+'  id  FROM '+@table+'  '+@where+'  ORDER BY id ) AS T'
set @sql=@sql+') '+@where1+' )order by id'
Declare @sql1  nvarchar(2000) 
set  @sql1='   SELECT TOP '+CAST(@pagesize as nvarchar (50))+'  '+@field+'  FROM  '+@table
set @sql1=@sql1+' WHERE (ID <  =   (SELECT Min(id)  from ( '
set @sql1=@sql1+ 'SELECT TOP '+CAST(@pagestr  as nvarchar(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 nvarchar (50))+'  '+@field+'  FROM  '+@table+ ' '+ @where+'   ORDER BY id '
	/*set @sql='  select top  '+CAST(@pagesize as nvarchar (50))+'  '+@field+'  FROM  '+@table+ ' '+'   ORDER BY id '*/
if (@page=1)
	set @sql1='  select top  '+CAST(@pagesize as nvarchar (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 OFF 
GO
SET ANSI_NULLS OFF 
GO











CREATE   PROCEDURE [hiweb_saveBbsLog]
@mainid int =null,
@reid int =null,
@int int =null,
@addOrDel int = null,
@saveType int =null,
@text nvarchar(250)=null,
@saveUser nvarchar(150)=null,
@saveUserID int =null

 AS

Declare @title  nvarchar(200) 
Declare @userName  nvarchar(200) 
Declare @userID int 




if (@mainid is null)
BEGIN
	select  @mainid=mainID,@userName=saveUser,@userID=saveUserID  from zydn_BBSRe where id =@reid
	select  @title=title  from zydn_BBSMain where id = @mainid
END
else
BEGIN
	select  @title=title,@userName=saveUser,@userID=saveUserID  from zydn_BBSMain where id =@mainid
END

insert into [zydn_BbsLog]
	(mainID,reID,userName,userID,saveUserName,saveUserID,saveDate,saveType,mainTitle,mInt,mType,mText	
	)
	values
	(
	@mainid,@reid,@userName,@userID,@saveUser,@saveUserID,getDate(),@saveType,@title,@int,@addOrDel,@text
	
	)











GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
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 nvarchar(20)=null,
@menuid int =null,
@saveAddress nvarchar(100)=null,
@saveIP   nvarchar(50)=null,
@vote   int =null,
@saveUserID int =null,
@saveUser  nvarchar(50)=null,
@nDate datetime = null,
@newPostID int =null output
 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,
		endTime,
		isDel
		) values (
		@bbsTitle ,
		@content ,
		@saveUser,
		getDate(),
		@saveUserID,
		0,
		@saveUser,
		getDate(),
		@saveUserID,
		@vote,
		0,
		0,
		@prefix,
		0,
		0,
		0,
		0,
		0,
		'',
		'',
		@menuid,
		@saveAddress,
		@saveIP,
		@postType,
		0,
		getDate(),
		0
		)
		
		 update  zydn_User_Base set  Count_Comment=Count_Comment+1 where id= @saveUserID
		Declare  @oDate datetime
		Declare  @newID int 
		select  @newID = max(id)  from [zydn_BBSMain]
		set @newPostID=@newID 
		select  @oDate =bbsNewDate from [zydn_menu] where mid=@menuid
		
			              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_BBSMain] set 
		title=@bbsTitle ,
		content=@content,
		prefix=@prefix
		where id=@bbsid
		set @newPostID=@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_saveBbsRe] 
@content ntext =null,
@mainID int =null,
@saveUser nvarchar(100)=null,
@saveUserID int=null,
@saveIP nvarchar(50) =null,
@saveAddress nvarchar(50)=null,
@menuid int =null,
@newDate dateTime =null,
@newPostID int =null output
AS


Declare @maxLayer int
Declare @bbsNewTitle  nvarchar(50) 

select @maxlayer = max(layerInt)   from zydn_BBSRe where mainID=@mainID

if (@maxlayer is null) 
set @maxlayer=0

set @maxlayer=@maxlayer+1

select @bbsNewTitle=title from zydn_BBSMain where  id=@mainID
set @bbsNewTitle=left(@bbsNewTitle,40)
update zydn_BBSMain  set reCount=reCount+1,endTime=getDate(),reUser=@saveUser,reDate=getDate() where id=@mainID
update  [zydn_menu]   set bbsReCount=bbsReCount+1,bbsNewCount=bbsNewCount+1,bbsNewDate=getDate(),bbsNewUser=@saveUser,bbsNewTitle='re:'+@bbsNewTitle,bbsNewID=@mainID  where mid=@menuid
insert into zydn_BBSRe(content, mainID,  saveUser,saveUserID, saveDate, saveIP, saveAddress,layerInt,menuid,isDel)
		 values(@content,@mainID,@saveUser,@saveUserID,getDate(),@saveIP,@saveAddress,@maxlayer,@menuid,0)

select @newPostID=max(id) from [zydn_BBSRe]



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 nvarchar(100)=null,
@fName nvarchar(100)=null,
@fPath nvarchar(255)=null,
@fType int =null,
@uName nvarchar(100)=null,
@uID int =null,
@fSize int =null,
@sexName nvarchar(10)=null,
@nExName nvarchar(10)=null,
@uIP nvarchar(50)=null,
@EXIF nvarchar(255)=null,
@newid int =null output
 AS
INSERT INTO   [zydn_UpFile]
	([SourceName],[FileName],[FilePath],[FileType],[UpDateTime],[UpUser],[UpUserID],[FileSize],[sExName],[userCount],[uIP],[nExName],[EXIF])
	VALUES
	(@sName,@fName,@fPath,@fType,getDate(),@uName,@uID,@fSize,@sexName,0,@uIP,@nExName,@EXIF)
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 ON 
GO







CREATE PROCEDURE [hiweb_saveImgSetup]
@name nvarchar(50) =null,
@value nvarchar(300)=null,
@type nvarchar(100)=null,
@uid int =null,
@uname nvarchar(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 nvarchar(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 nvarchar(250)=null,
@content ntext =null,
@fromUser nvarchar(250),
@toUser nvarchar(250),
@erUser nvarchar(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 ON 
GO









CREATE proc hiweb_saveMultiyGoods
@tabName nvarchar(50),
@tabID int,
@prices nvarchar(50),
@menuName nvarchar(50),
@menuID int,
@typeID int,
@userID int,
@userName nvarchar(50),
@orderID nvarchar(50),
@IP nvarchar(50),
@Address nvarchar(250)
as
declare @typeName nvarchar(50),@typePrice nvarchar(20),@saveUserID int,@saveUser nvarchar(50),@title nvarchar(50),@content nvarchar(250),@Price numeric(10,2)
select @typeName=TypeName,@typePrice=TypePrice from zydn_OrderType where ID = @typeID
declare @tempsql nvarchar(250)
set @tempsql = 'select @saveUserID=SaveUserID,@saveUser=SaveUser,@title=title,@content=content,@Price='+@prices+' from '+@tabName+' where ID = @tabIDs'
exec sp_executesql @tempsql,N'@saveUserID int output,@saveUser nvarchar(50) output,@title nvarchar(50) output,@content nvarchar(250) output,@Price numeric(10,2) output,@tabIDs int',
@saveUserID output,@saveUser output,@title output,@content output,@Price output,@tabIDs=@tabID
declare @oid nvarchar(50),@count int,@oldNum int
select @oid=OrderID from zydn_orderList where userID=@userID and isCart=1
if(@oid!='')
begin
	select @count=count(0) from zydn_OrderList where OrderID=@oid and TabID=@tabID and userID=@userID and isCart=1
	if(@count>0)
	begin
		select @oldNum=CommodityNum from zydn_OrderList where OrderID=@oid and TabID=@tabID and userID=@UserID and isCart=1
		update zydn_OrderList set CommodityNum=@oldNum+1,Total=(@oldNum+1)*@Price where OrderID=@oid and TabID=@tabID and userID=@UserID and isCart=1
	end
	else
	begin
		
		insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,SellerID,SellerName,TabID,TypeName,isCart) 
		values(@UserID,@oid,@UserName,@title,@TypeID,@Price,1,@Price,'',@TabName,@IP,@Address,0,@menuName,@menuID,getDate(),@saveUserID,@saveUser,@TabID,@typeName,1)
	end
end
else
begin
	select @count=count(0) from zydn_OrderList where OrderID=@orderID and TabID=@tabID and userID=@userID and isCart=1
	if(@count>0)
	begin
		select @oldNum=CommodityNum from zydn_OrderList where OrderID=@orderID and TabID=@tabID and userID=@UserID and isCart=1
		update zydn_OrderList set CommodityNum=@oldNum+1,Total=(@oldNum+1)*@Price where OrderID=@orderID and TabID=@tabID and userID=@UserID and isCart=1
	end
	else
	begin
		
		insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,SellerID,SellerName,TabID,TypeName,isCart) 
		values(@UserID,@orderID,@UserName,@title,@TypeID,@Price,1,@Price,'',@TabName,@IP,@Address,0,@menuName,@menuID,getDate(),@saveUserID,@saveUser,@TabID,@typeName,1)
	end
end


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




/*------------------------更新生成订单表信息-----------------------------*/
CREATE proc hiweb_saveOrder
(
	@UserID int = null,
	@OrderID nvarchar(50) = null,
	@UserName nvarchar(50) = null,
	@CommodityName nvarchar(50) = null,
	@TypeID int = null,
	@Price numeric(10,2) = null,
	@CommodityNum int = null,
	@Total numeric(10,2) = null,
	@Mark nvarchar(100) = null,
	@TabName nvarchar(50) = null,
	@IP nvarchar(50) = null,
	@Address nvarchar(100) = null,
	@OrderState tinyint = null,
	@ColumName nvarchar(50) = null,
	@ColumID int = null,
	@TimeStar datetime=null,
	@TimeEnd datetime=null,
	@SellerID int = null,
	@SellerName nvarchar(50) = null,
	@TabID int = null,
	@TypeName nvarchar(50) = null,
	@field nvarchar(50)=null
)
as
	begin transaction
		if((@TimeStar=null or @TimeStar='')  and (@TimeEnd=null or @TimeEnd=''))
			begin
				insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,SellerID,SellerName,TabID,TypeName,isCart,field) 
				values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@SellerID,@SellerName,@TabID,@TypeName,0,@field)
				
				if @@error<>0
				rollback transaction

			end
		else if(@TimeStar=null or @TimeStar='')
			begin
				insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeEnd,SellerID,SellerName,TabID,TypeName,isCart,field) 
				values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeEnd,@SellerID,@SellerName,@TabID,@TypeName,0,@field)
				
				if @@error<>0
				rollback transaction

			end
		else if(@TimeEnd=null or @TimeEnd='')
			begin
				insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeStar,SellerID,SellerName,TabID,TypeName,isCart,field) 
				values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeStar,@SellerID,@SellerName,@TabID,@TypeName,0,@field)
				
				if @@error<>0
				rollback transaction

			end
		else
			begin
				insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeStar,TimeEnd,SellerID,SellerName,TabID,TypeName,isCart,field) 
				values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeStar,@TimeEnd,@SellerID,@SellerName,@TabID,@TypeName,0,@field)
				
				if @@error<>0
				rollback transaction
			end
	commit transaction


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





/*-----------------------------更新商品加入购物车-----------------------------------*/
CREATE  proc hiweb_saveOrderByCart
	@outNum int output,
	@UserID int = null,
	@OrderID nvarchar(50) = null,
	@UserName nvarchar(50) = null,
	@CommodityName nvarchar(50) = null,
	@TypeID int = null,
	@Price numeric(10,2) = null,
	@CommodityNum int = null,
	@Total numeric(10,2) = null,
	@Mark nvarchar(100) = null,
	@TabName nvarchar(50) = null,
	@IP nvarchar(50) = null,
	@Address nvarchar(100) = null,
	@OrderState tinyint = null,
	@ColumName nvarchar(50) = null,
	@ColumID int = null,
	@TimeStar datetime=null,
	@TimeEnd datetime=null,
	@SellerID int = null,
	@SellerName nvarchar(50) = null,
	@TabID int = null,
	@TypeName nvarchar(50) = null,
	@field nvarchar(50)=null,
	@isCart tinyint
as
	begin
		declare @count int
		select @count=count(0) from zydn_OrderList where OrderID=@OrderID and TabID=@TabID and userID=@UserID and isCart=1
		if(@count>0)
			begin
				declare @oldNum int
				declare @oldTotal numeric(10,2)
				select @oldNum=CommodityNum,@oldTotal=Total from zydn_OrderList where OrderID=@OrderID and TabID=@TabID and userID=@UserID and isCart=1
				update zydn_OrderList set CommodityNum=@oldNum+@CommodityNum,Total=@oldTotal+@Total where OrderID=@OrderID and TabID=@TabID and userID=@UserID and isCart=1
			end
		else
			begin
				if((@TimeStar=null or @TimeStar='')  and (@TimeEnd=null or @TimeEnd=''))
					begin
						insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,SellerID,SellerName,TabID,TypeName,isCart,field) 
						values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@SellerID,@SellerName,@TabID,@TypeName,@isCart,@field)
					end
				else if(@TimeStar=null or @TimeStar='')
					begin
						insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeEnd,SellerID,SellerName,TabID,TypeName,isCart,field) 
						values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeEnd,@SellerID,@SellerName,@TabID,@TypeName,@isCart,@field)
					end
				else if(@TimeEnd=null or @TimeEnd='')
					begin
						insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeStar,SellerID,SellerName,TabID,TypeName,isCart,field) 
						values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeStar,@SellerID,@SellerName,@TabID,@TypeName,@isCart,@field)
					end
				else
					begin
						insert into zydn_OrderList(UserID,OrderID,UserName,CommodityName,TypeID,Price,CommodityNum,Total,Mark,TabName,IP,Address,OrderState,ColumName,ColumID,CreateTime,TimeStar,TimeEnd,SellerID,SellerName,TabID,TypeName,isCart,field) 
						values(@UserID,@OrderID,@UserName,@CommodityName,@TypeID,@Price,@CommodityNum,@Total,@Mark,@TabName,@IP,@Address,@OrderState,@ColumName,@ColumID,getDate(),@TimeStar,@TimeEnd,@SellerID,@SellerName,@TabID,@TypeName,@isCart,@field)
					end
			end
		select @outNum=count(0) from zydn_OrderList where OrderID=@OrderID and userID=@UserID and isCart=1
	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_saveReview] 
@tabid int =null,
@tab  nvarchar(255) =null,
@title nvarchar(100) =null,
@mid int =null,
@isExamine int =null,
@saveUser nvarchar(100)=null,
@saveUserID int=null,
@saveUserIP nvarchar(50)=null,
@saveAddress nvarchar(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 nvarchar(1000)
set @sql='update  ['+@tab+']   set Count_Revert=Count_Revert+1 where id='+CAST(@tabid as nvarchar(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 nvarchar(200)=null,
@tabid int =null,
@mid int =null,
@toUser nvarchar(200)=null,
@endDate datetime =null,
@title nvarchar(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 ON 
GO









create proc hiweb_saveTData
@mid int,
@userID int,
@userName nvarchar(50),
@pAwardsInt int,
@pAwardsMoney int
as
declare @count int
select @count=count(0) from zydn_setPlan where mid=@mid
if(@count<1)
insert into zydn_setPlan(mid,userID,userName,pAwardsInt,pAwardsMoney) values(@mid,@userID,@userName,@pAwardsInt,@pAwardsMoney)





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 nvarchar(50)=null,
@fieldAsname nvarchar(50)=null,
@isFind int =null,
@isNull int =null,
@editMode int =null,
@isRow int =null,
@isEdit 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],
	[isEdit]
	)
	values
	(
	@fieldName,
	@fieldAsname,
	@isFind,
	@isNull,
	@isRow,
	@editMode,
	@isEdit
	)



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO









CREATE PROCEDURE [hiweb_saveUserModiContent]
@tabName nvarchar(100)=null,
@tabID int=null,
@menuID int=null,
@menuName nvarchar(100) =null,
@Content ntext=null,
@tabTitle nvarchar(100) =null,
@userID int =null,
@userName nvarchar(50) =null,
@userIP nvarchar(30)=null
 AS
insert into  zydn_uModiContent 
(
menuid,
menuName,
tabid,
tab,
tabTitle,
Content,
userIP,
createTime,
userID,
userName,
setType
) 
values
(
@menuID,
@menuName,
@tabID,
@tabName,
@tabTitle ,
@Content ,
@userIP ,
getDate(),
@userID ,
@userName,
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_saveWebInfo] 
@sTime nvarchar(500) =null,
@inCount nvarchar(500) =null,
@eTime nvarchar(500) =null,
@isEnd nvarchar(500) =null,
@isWeb nvarchar(500) =null,
@tTime nvarchar(500) =null,
@webCode nvarchar(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 nvarchar(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_setBbsElite] 
/*锁定贴子*/
@id int =null,
@menuid int =null output,
@userid int =null output
AS
  select @menuid=menuid,@userid=saveUserID from  zydn_BBSMain  where id=@id
  update zydn_BBSMain set isElite=1 where id=@id




GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO









CREATE PROCEDURE [hiweb_setBbsTop] 
/*锁定贴子*/
@id int =null,
@topType int =null,
@menuid int =null output,
@userid int =null output
AS

  select @menuid=menuid,@userid=saveUserID from  zydn_BBSMain  where id=@id
  update zydn_BBSMain set isTop=@topType where id=@id




GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO









CREATE PROCEDURE [hiweb_setDateNewDate] 
@newDate dateTime =null,
@mid int =null
AS
Declare @oldDate datetime
select   @oldDate=bbsNewDate from [zydn_menu] where mid=@mid
if (@oldDate <> @newDate and  @oldDate  is not  null)
BEGIN
	update [zydn_menu] set bbsNewCount=0
	update [zydn_menu] set  bbsNewDate=@newDate  where mid=@mid
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_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_setNewField] AS
/* 这个存储过程, 用来初始化在升级过程中新增的表或字段的数据. */
update zydn_menu set menuClickCount=0 where menuClickCount is Null
update  zydn_upFile set   EXIF=''  , fileTitle='', fileCBS='' where EXIF is null
update  zydn_menu set  isTop=100 where isTop is null
delete zydn_OrderType where TypeName is null





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 nvarchar(200)=null,
@userEmail nvarchar(30)=null,
@userA nvarchar (200)=null,
@newPass nvarchar(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 OFF 
GO
SET ANSI_NULLS OFF 
GO





CREATE PROCEDURE [hiweb_setUserLevel]   /*设置用户的等级*/
@userID  int = null

 AS


Declare @uInt  int
Declare @Lname nvarchar(250)
Declare @Lid  int 

update zydn_User_Base set Integral_Total=Integral_Base+(Integral_Expert*2)  where id=@userID
select @uInt = Integral_Total  from zydn_User_Base  where id=@userID

select top 1  @Lname =LevelName,@Lid=id  from zydn_userLevel   where  minInt <  @uInt  order by  minInt  desc 
update zydn_User_Base set  LevelName=@Lname,   LevelID=@Lid   where id=@userID


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO









CREATE proc hiweb_tenderPay
@outNum int output,
@uid int,
@tInt int,
@tMoney int
as
declare @usertInt int, @usertMoney int
select @usertInt=Integral_Base,@usertMoney=Money from zydn_User_Base where ID=@uid
if(@usertInt<@tInt or @usertMoney<@tMoney)
begin
	set @outNum=0
end
else
begin
	set @outNum=1
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_tender_isOver
@isOK int output,
@id int
 AS
declare @num int
declare @pid int
select @pid=planID from zydn_tender where id=@id
select @num=isOK  from zydn_setPlan where mid=@pid
if(@num=1)
begin
	set @isOK=@num
end
else
begin
	update zydn_setPlan set isOK=1 where mid=@pid
	update zydn_tender set isOK=1 where id=@id
	set @isOK=0
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 nvarchar(1000)
Declare @table nvarchar(100)
Declare @tabid nvarchar(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 nvarchar(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 nvarchar(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 ON 
GO
SET ANSI_NULLS ON 
GO




CREATE proc hiweb_updateEcChange_state
(
	@state int=null,--/状态编号
	@stateName nvarchar(50)=null,--/状态名称
	@remark ntext=null,--/备注信息
	@userid nvarchar(50)=null,--/用户编号
	@userName nvarchar(50)=null,--/用户名
	@userIP nvarchar(50)=null,--/用户ip
	@id int=null,--/id
	@orderNum nvarchar(50)=null--/订单好
)
as
begin transaction

	declare @dt datetime
	declare @user nvarchar(50)
	select @dt=saveDate,@user=apmName from zydn_ExChange where id=@id
	
	update zydn_ExChange set state=@state,stateName=@stateName,remark=@remark,updateDate=getdate() where id=@id and orderNum =@orderNum
	if(@@error<>0)
	rollback transaction

	insert into zydn_ExChangeIndex(exID,orderNum,state,stateName,createDate,createIP,createUser,createUserID,remark,orderCreateTime,orderCreateName)
	values(@id,@orderNum,@state,@stateName,getdate(),@userIP,@userName,@userid,@remark,@dt,@user)
	if(@@error<>0)
	rollback transaction
commit transaction




GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO





CREATE proc hiweb_updateExChange_Rate
(
	@moneyName nvarchar(50)=null,--/货币类型
	@Money numeric(9)=null,--/货币兑换量
	@runMoney numeric(9)=null,--/人民币量
	@rate numeric(9)=null,--/手续费
	@ckfl numeric(9,3)=null,--/费率
	@type nvarchar(50)=null,--/当前兑换的类型 In Out
	@orderNum nvarchar(50)=null,--/订单号码
	@exID int=null,--/预约单编号	
	@price float(8)=null--/报价单位
)
as
begin transaction
	
	insert into zydn_ExChangeMoney(exID,type,moneyType,[money],runMoney,Rate,ckfl,orderNum,createDate,price)
	values(@exID,@type,@moneyName,@Money,@runMoney,@rate,@ckfl,@orderNum,getdate(),@price)
	
	if(@@error<>0)
	rollback transaction
	if(@type='In')
	    begin
		update zydn_ExChange set inMoney=inMoney+@runMoney-@rate where id=@exID

		if(@@error<>0)
		rollback transaction
	    end
	else
	    begin
		update zydn_ExChange set outMoney=outMoney+@runMoney+@rate where id=@exID
		if(@@error<>0)
		rollback transaction
	    end	

commit transaction



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




CREATE PROCEDURE [hiweb_userLogin]
@userName nvarchar (50) =null ,
@userPass nvarchar(50)=null,
@Last_IP nvarchar(50) =null,
@addInt int =null,
@pas1 nvarchar(50)=null output,
@GroupID nvarchar(100) =null output,
@GroupName nvarchar(250)=null output,
@Money int =null output,
@LevelID int =null output,
@Integral_Base int =null output,
@Count_Login int =null output,
@Email nvarchar(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 or @addInt>0)
	BEGIN
		update zydn_user_base set 
			Integral_Base=Integral_Base+@addInt ,
			Count_Login=Count_Login+1,Date_Login=getDate(),Last_IP=@Last_IP
		where id=@uid
		set @Count_Login=@Count_Login+1
	END







GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO




/*---------------初始化博客所使用的表的字段信息------(2011-07-27)---------------*/
create procedure zydn_home_Initialization
(
	@menuTabBlog nvarchar(50)=null,/*---------------------------*/
	@menuTabBunBlog nvarchar(50)=null,/*---------------------------*/
	@menuTabMusic nvarchar(50)=null,/*---------------------------*/
	@menuTabBunMusic nvarchar(50)=null,/*---------------------------*/
	@menuTabPhoto nvarchar(50)=null,/*---------------------------*/
	@menuTabBunPhoto nvarchar(50)=null,/*---------------------------*/
	@menuTabSupply nvarchar(50)=null,/*-----------------------------*/
	@menuTabShop nvarchar(50)=null,/*-------------------------------*/
	@idx nvarchar(500) output/*---------------------------*/
)
as
begin transaction	
	
	declare @tablename varchar(100), @columnname1 varchar(100),@columnname2 varchar(100),@columnname3 varchar(100), @tab varchar(100) 
	declare @defname varchar(100) 
	declare @cmd varchar(100) 	
	set @columnname1='bunchid' 	
	set @columnname2='competenceID' 	
	set @columnname3='typeMenuID' 	
	declare @idex int
	set @idex=0
	/*---------------------------用户日志--------------------------------------------------------*/	
	while(@idex<8)
		begin
			if(@idex=0)			
				set @tablename=@menuTabBlog
			else if(@idex=1)
				set @tablename=@menuTabBunBlog
			else if(@idex=2)
				set @tablename=@menuTabMusic
			else if(@idex=3)
				set @tablename=@menuTabBunMusic
			else if(@idex=4)
				set @tablename=@menuTabPhoto
			else if(@idex=5)
				set @tablename=@menuTabBunPhoto
			else if(@idex=6)
				set @tablename=@menuTabSupply
			else if(@idex=7)
				set @tablename=@menuTabShop
			set @idex=@idex+1
			print @tablename
			if exists(select * from sysobjects where id=object_id(@tablename) and objectproperty(id,N'isUserTable')=1)
				begin	
					   
					if exists(select * from syscolumns where object_id(@tablename)=id and name=@columnname1)
						begin		
							set @cmd=null	
							set @defname=null			
							select @defname = name 	from sysobjects so join sysconstraints sc on so.id = sc.constid where object_name(so.parent_obj) = @tablename and so.xtype = 'D' and sc.colid =(select colid from syscolumns 	where id = object_id(@tablename) and name = @columnname1) 
							select @cmd='alter table '+ @tablename+ ' drop constraint '+ @defname 					
							if(@cmd is not null)
								exec (@cmd)
							exec('alter table '+@tablename+' add default 0 for '+@columnname1)
							if @@error<>0
								rollback transaction	
							exec('update '+@tablename+' set '+@columnname1+'=0 where '+@columnname1+' is null')
						end
					else
						exec('alter table '+@tablename+' add '+@columnname1+' int default 0')
						if @@error<>0
							rollback transaction	
		
					if exists(select * from syscolumns where object_id(@tablename)=id and name=@columnname2)
						begin		
							set @cmd=null	
							set @defname=null			
							select @defname = name 	from sysobjects so join sysconstraints sc on so.id = sc.constid where object_name(so.parent_obj) = @tablename and so.xtype = 'D' and sc.colid =(select colid from syscolumns 	where id = object_id(@tablename) and name = @columnname2) 
							select @cmd='alter table '+ @tablename+ ' drop constraint '+ @defname 					
							if(@cmd is not null)
								exec (@cmd)
							exec('alter table '+@tablename+' add default 0 for '+@columnname2)
							if @@error<>0
								rollback transaction	
							exec('update '+@tablename+' set '+@columnname2+'=0 where '+@columnname2+' is null')
						end
					else
						exec('alter table '+@tablename+' add '+@columnname2+' int default 0')
						if @@error<>0
							rollback transaction	
		
					if exists(select * from syscolumns where object_id(@tablename)=id and name=@columnname3)
						begin		
							set @cmd=null	
							set @defname=null							
							select @defname = name 	from sysobjects so join sysconstraints sc on so.id = sc.constid where object_name(so.parent_obj) = @tablename and so.xtype = 'D' and sc.colid =(select colid from syscolumns 	where id = object_id(@tablename) and name = @columnname3) 
							select @cmd='alter table '+ @tablename+ ' drop constraint '+ @defname 					
							if(@cmd is not null)
								exec (@cmd)
							exec('alter table '+@tablename+' add default 0 for '+@columnname3)
							if @@error<>0
								rollback transaction	
							exec('update '+@tablename+' set '+@columnname3+'=0 where '+@columnname3+' is null')
						end
					else
						exec('alter table '+@tablename+' add '+@columnname3+' int default 0')
						if @@error<>0
							rollback transaction	
				end	
			else
				begin
					set @idx='当前配置的<'+@tablename+'>挂解表不在系统中,请重新配置'
					commit transaction
					return
				end	
		end	
	set @idx=1			
commit transaction


GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

