表名:ZL_SearchView

简要说明:

ZL_SearchView

GO

CREATE VIEW [dbo].[ZL_SearchView] AS

SELECT GeneralID AS ID,S=0,NodeID,ItemID,TableName,Title,Inputer,Hits,CreateTime,[Status],PageUrl='',TagKey,HtmlLink,TopImg,0 As LinPrice,Content=dbo.ZL_StripeHtmlTag(content)

FROM (SELECT A.*,Content='' FROM ZL_CommonModel A LEFT JOIN ZL_C_Article B ON A.ItemID=B.ID)A WHERE [Status]=99 And TableName='ZL_C_Article'

UNION

select ID,S=1,Nodeid,ItemID,TableName,Proname,AddUser,AllClickNum,AddTime,Sales,'',Kayword,'',Thumbnails,LinPrice,Content='' 

FROM ZL_Commodities where Sales=1 And Recycler=0 And Istrue=1 And UserShopID=0

UNION

select ID,S=2,CateID,Pid,'ZL_Guest_BarView',Title,CUName,HitCount,CDate,[Status],'','','','',0,Content='' 

from ZL_Guest_BarView where [Status]=99

UNION 

SELECT ID,S=3,QueType,0,'',Qcontent,UserName,0,AddTime,[Status],'','','','',0,Content='' 

FROM ZL_Ask where [Status]>0

UNION

SELECT Gid,S=4,Cateid,0,'',Title,(select UserName from ZL_User where ZL_User.UserID=ZL_Guestbook.Userid),0,Gdate,[Status],'','','','',0,Content='' 

FROM ZL_Guestbook where Parentid=0 And [Status]=1

UNION

SELECT ID,S=5,Nodeid,ItemID,TableName,Proname,AddUser,AllClickNum,AddTime,Sales,'',Kayword,'',Thumbnails,LinPrice,Content='' 

FROM ZL_Commodities where Sales=1 And Recycler=0 And Istrue=1 And UserShopID>0


--注意:将清空全表数据

detele from ZL_SearchView

--注意:将删除整个表

drop table ZL_SearchView

--注意:清空且复位表ID序列为初始值

TRUNCATE table ZL_SearchView