📄 cs_gallery_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_gallery_Search_PostReindex]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[cs_gallery_Search_PostReindex]
GO
CREATE PROCEDURE [dbo].cs_gallery_Search_PostReindex
(
@RowCount int,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
SET ROWCOUNT @RowCount
SELECT
T.*,
SortOrder = 1,
P.PostID,
P.Subject,
P.Body,
P.FormattedBody,
P.PostLevel,
P.PropertyNames as PostPropertyNames, P.PropertyValues as PostPropertyValues,
Username = P.PostAuthor,
P.PostConfiguration,
AttachmentFilename = ISNULL ( (SELECT [FileName] FROM cs_PostAttachments WHERE PostID = P.PostID), ''),
Replies = (SELECT COUNT(P2.PostID) FROM cs_Posts P2 (nolock) WHERE P2.ParentID = P.PostID AND P2.PostLevel != 1)
FROM
cs_Posts P (nolock),
cs_Threads T,
cs_Sections F
WHERE
F.SectionID = P.SectionID AND
F.IsActive = 1 AND
F.IsSearchable = 1 AND
P.IsApproved = 1 AND
T.ThreadID = P.ThreadID and
P.IsIndexed = 0 and
F.SettingsID = @SettingsID and
F.ApplicationType = 2 AND
P.PostLevel = 1
ORDER BY
T.ThreadDate DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
grant execute on [dbo].cs_gallery_Search_PostReindex to public
go
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -