📄 cs_search_postreindex.prc
字号:
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[cs_Search_PostReindex]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[cs_Search_PostReindex]
GO
CREATE procedure [dbo].cs_Search_PostReindex
(
@RowCount int = 25,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
BEGIN
SET ROWCOUNT @RowCount
SELECT
P.PostID,
P.ParentID,
P.FormattedBody,
P.Body,
P.SectionID,
P.PostDate,
P.PostLevel,
P.SortOrder,
P.Subject,
T.ThreadDate,
T.ThreadID,
Replies = (SELECT COUNT(P2.PostID) FROM cs_Posts P2 (nolock) WHERE P2.ParentID = P.PostID AND P2.PostLevel != 1),
T.IsLocked,
T.IsSticky,
Username = P.PostAuthor,
P.IsApproved,
T.TotalViews,
HasRead = 0,
P.IPAddress,
P.PostType,
P.EmoticonID,
P.PostConfiguration
FROM
cs_Posts P,
cs_Threads T,
cs_Sections F
WHERE
F.SectionID = T.SectionID AND
T.ThreadID = P.ThreadID AND
F.IsActive = 1 AND
F.IsSearchable = 1 AND
P.IsApproved = 1 AND
P.IsIndexed = 0 and
F.SettingsID = @SettingsID and
F.ApplicationType = 0
ORDER BY
T.ThreadDate DESC
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
grant execute on [dbo].[cs_Search_PostReindex] to public
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -