cs_GetTotalPostCount
ALTER PROCEDURE [dbo].cs_GetTotalPostCount
(
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT TOP 1
TotalPosts
FROM
forums_Statistics where SettingsID = @SettingsID
/**//*我在数据库里好象没看过这张表*/
ALTER PROCEDURE [dbo].cs_GetTotalPostCount
(
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT TOP 1
TotalPosts
FROM
forums_Statistics where SettingsID = @SettingsID
/**//*我在数据库里好象没看过这张表*/
cs_GetSectionSubscriptionTypes
ALTER procedure [dbo].cs_GetSectionSubscriptionTypes
(
@UserID int,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT SubscriptionType, SectionID FROM cs_TrackedSections WHERE UserID=@UserID and SettingsID = @SettingsID
/**//*获取某用户的所有订阅*/
ALTER procedure [dbo].cs_GetSectionSubscriptionTypes
(
@UserID int,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT SubscriptionType, SectionID FROM cs_TrackedSections WHERE UserID=@UserID and SettingsID = @SettingsID
/**//*获取某用户的所有订阅*/
cs_GetAnonymousUserID
ALTER Proc [dbo].cs_GetAnonymousUserID
(
@SettingsID int,
@UserID int output
)
as
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
Select @UserID = cs_UserID FROM cs_vw_Users_FullUser where SettingsID = @SettingsID and IsAnonymous = 1
/**//*获取匿名用户的ID*/
ALTER Proc [dbo].cs_GetAnonymousUserID
(
@SettingsID int,
@UserID int output
)
as
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
Select @UserID = cs_UserID FROM cs_vw_Users_FullUser where SettingsID = @SettingsID and IsAnonymous = 1
/**//*获取匿名用户的ID*/
cs_gallery_Search_PostReindex
ALTER PROCEDURE dbo.cs_gallery_Search_PostReindex
(
@RowCount int,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SET ROWCOUNT @RowCount
SELECT
T.*,
SortOrder = 1,
P.PostID,
P.ParentID,
P.Subject,
P.Body,
P.FormattedBody,
P.PostLevel, P.PostName, P.ApplicationPostType, P.UserTime,
P.PostPropertyNames as PostPropertyNames, P.PostPropertyValues as PostPropertyValues,
P.Points as PostPoints,
Username = P.PostAuthor, P.UserID,
P.PostConfiguration,
AttachmentFilename,ContentType, IsRemote, [Height], [Width], FriendlyFileName, ContentSize, [FileName],p.Created,
-- 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_vw_PostsWithAttachmentDetails P (nolock),
-- 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
ALTER PROCEDURE dbo.cs_gallery_Search_PostReindex
(
@RowCount int,
@SettingsID int
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SET ROWCOUNT @RowCount
SELECT
T.*,
SortOrder = 1,
P.PostID,
P.ParentID,
P.Subject,
P.Body,
P.FormattedBody,
P.PostLevel, P.PostName, P.ApplicationPostType, P.UserTime,
P.PostPropertyNames as PostPropertyNames, P.PostPropertyValues as PostPropertyValues,
P.Points as PostPoints,
Username = P.PostAuthor, P.UserID,
P.PostConfiguration,
AttachmentFilename,ContentType, IsRemote, [Height], [Width], FriendlyFileName, ContentSize, [FileName],p.Created,
-- 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_vw_PostsWithAttachmentDetails P (nolock),
-- 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
cs_GetSectionSubscriptionType
ALTER procedure [dbo].cs_GetSectionSubscriptionType
(
@UserID int,
@SectionID int,
@SettingsID int,
@SubType int OUTPUT
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT SubscriptionType FROM cs_TrackedSections WHERE SectionID=@SectionID AND UserID=@UserID and SettingsID = @SettingsID
/**//*获取某版块/博客的订阅类型*/
ALTER procedure [dbo].cs_GetSectionSubscriptionType
(
@UserID int,
@SectionID int,
@SettingsID int,
@SubType int OUTPUT
)
AS
SET Transaction Isolation Level Read UNCOMMITTED
/**//*设置事务隔离级别,Read UNCOMMITTED 执行脏读或 0 级隔离锁定,这表示不发出共享锁,
也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更
改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有
语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。*/
SELECT SubscriptionType FROM cs_TrackedSections WHERE SectionID=@SectionID AND UserID=@UserID and SettingsID = @SettingsID
/**//*获取某版块/博客的订阅类型*/