我安装AspNetForum的一些笔记,可以看看\Engine\Data\SqlDataProvider.cs替换5000为3000 修改Statistics_ResetTopPosters存储过程为--select top 500 username ,attributes,totalposts from users order by totalposts desc--exec Statistics_ResetTopPosters CREATE procedure Statistics_ResetTopPosters AS BEGIN DECLARE @Usercount int DECLARE @LoopCounter int SET NOCOUNT ON CREATE Table #Top500Users ( Rank int IDENTITY (1, 1) NOT NULL, UserName nvarchar(50) ) -- Select into temp table INSERT INTO #Top500Users (UserName) SELECT TOP 500 UserName FROM Users ORDER BY TotalPosts DESC -- How many users did we select? SELECT @Usercount = count(*) FROM #Top500Users -- Set the loop counter SET @LoopCounter = 1 WHILE (@LoopCounter <= @Usercount) BEGIN -- clear the flags for top 25, 50, and 100 UPDATE Users SET Attributes = (convert(int, Attributes) & 0xFFFFFFF3) WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 25 poster IF (@LoopCounter < 26) UPDATE Users SET Attributes = (Attributes ^ 4) WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 50 poster IF (@LoopCounter > 25) AND (@LoopCounter < 51) UPDATE Users SET Attributes = (Attributes ^ 8) WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 100 poster IF (@LoopCounter > 50) AND (@LoopCounter < 101) BEGIN UPDATE Users SET Attributes = (Attributes ^ 16) WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) END
-- increment the coutner SET @LoopCounter = @LoopCounter + 1 END END GO除了普通的安装,修改config等等,就改了上面两个地方,就跑起来了 (-:
修改Statistics_ResetTopPosters存储过程为--select top 500 username ,attributes,totalposts from users order by totalposts desc--exec Statistics_ResetTopPosters
CREATE procedure Statistics_ResetTopPosters
AS
BEGIN
DECLARE @Usercount int
DECLARE @LoopCounter int SET NOCOUNT ON CREATE Table #Top500Users (
Rank int IDENTITY (1, 1) NOT NULL,
UserName nvarchar(50)
) -- Select into temp table
INSERT INTO #Top500Users (UserName)
SELECT TOP 500
UserName
FROM
Users
ORDER BY
TotalPosts DESC -- How many users did we select?
SELECT @Usercount = count(*) FROM #Top500Users -- Set the loop counter
SET @LoopCounter = 1 WHILE (@LoopCounter <= @Usercount)
BEGIN
-- clear the flags for top 25, 50, and 100
UPDATE Users
SET Attributes = (convert(int, Attributes) & 0xFFFFFFF3)
WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 25 poster
IF (@LoopCounter < 26)
UPDATE Users
SET Attributes = (Attributes ^ 4)
WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 50 poster
IF (@LoopCounter > 25) AND (@LoopCounter < 51)
UPDATE Users
SET Attributes = (Attributes ^ 8)
WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter) -- top 100 poster
IF (@LoopCounter > 50) AND (@LoopCounter < 101)
BEGIN
UPDATE Users
SET Attributes = (Attributes ^ 16)
WHERE Username collate SQL_Latin1_General_CP1_CI_AS = (SELECT Username FROM #Top500Users WHERE Rank = @LoopCounter)
END
-- increment the coutner
SET @LoopCounter = @LoopCounter + 1
END
END
GO除了普通的安装,修改config等等,就改了上面两个地方,就跑起来了 (-: