Cs_forums_thread_get
Alter procedure [DBO]. cs_forums_thread_get
/**//*
Procedure for getting basic information on a single thread.
To obtain basic information about a single topic
*/
(
@ Threadid int,
@ Userid int,
@ Settingsid int
)
SET transaction isolation level read uncommitted
/** // * Sets the transaction isolation level. Read uncommitted performs dirty read or 0 isolation locks, which means no shared lock is issued,
The exclusive lock is also not accepted. When this option is set, uncommitted read or dirty read can be performed on the data.
Change the value in the data, and the row can also appear in the dataset or disappear from the dataset. The role of this option and all
Set nolock to the same for all tables in the statement. This is the minimum limit among the four isolation levels. */
Select
T .*,
P. postid,
P. subject,
P. Body, P. formattedbody,
P. postconfiguration,
P. propertynames as postpropertynames,
P. propertyvalues as postpropertyvalues,
Username = T. postauthor,
Hasread = case
When @ userid = 0 then 0
When @ userid> 0 then (select convert (bit, count (*) from cs_vw_hasreadforum where (threadid is null and markreadafter> P. threadid) or (markreadafter is null and threadid = P. threadid) and userid = @ userid and sectionid = P. sectionid)
End
From
Cs_posts P,
Cs_threads t,
Cs_vw_users_fulluser u
Where
P. postid = P. parentid and
P. threadid = @ threadid and
T. threadid = P. threadid and
P. userid = U. cs_userid and P. settingsid = @ settingsid
Cs_forums_posts_postset_rssthreadless
Alter procedure DBO. cs_forums_posts_postset_rssthreadless
(
@ Pagesize int,
@ Sectionid int,
@ Settingsid int
)
As
SET transaction isolation level read uncommitted
/** // * Sets the transaction isolation level. Read uncommitted performs dirty read or 0 isolation locks, which means no shared lock is issued,
The exclusive lock is also not accepted. When this option is set, uncommitted read or dirty read can be performed on the data.
Change the value in the data, and the row can also appear in the dataset or disappear from the dataset. The role of this option and all
Set nolock to the same for all tables in the statement. This is the minimum limit among the four isolation levels. */
Begin
-- First set the rowcount
-- First, set the number of rows
Set rowcount @ pagesize
-- Select the individual posts
-- Query personal posts
Select
P. postid, P. threadid, P. parentid, P. postauthor, P. userid, P. sectionid, P. postlevel, P. sortorder, P. subject, P. postdate, P. isapproved,
P. islocked, P. isindexed, P. totalviews, P. Body, P. formattedbody, P. IPaddress, P. posttype, P. emoticonid, P. settingsid, P. aggviews,
P. propertynames as postpropertynames, P. propertyvalues as postpropertyvalues,
P. postconfiguration, P. usertime, P. applicationposttype, P. postname,
P. points as postpoints,
T. *, U .*,
T. islocked,
T. issticky,
Username = P. postauthor,
Threadstarterauthor = T. postauthor,
Threadstartdate = T. postdate,
Editnotes = (select editnotes from cs_posteditnotes where postid = P. postid ),
Attachmentfilename = isnull (select [filename] From cs_postattachments where postid = P. postid ),''),
Replies = 0, -- not used (select count (p2.postid) from cs_posts P2 (nolock) Where p2.parentid = P. postid and p2.postlevel! = 1 ),
Ismoderator = 0, -- not used
Hasread = 0 -- not used
From
Cs_posts P (nolock ),
Cs_threads t,
Cs_vw_users_fulluser u
Where
P. userid = U. cs_userid and
T. threadid = P. threadid and
T. sectionid = @ sectionid and
P. isapproved = 1 and
P. settingsid = @ settingsid
Order
P. postdate DESC
End
/** // * Query from the user information view and post table/topic table */
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service