1. 修改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
2. \Engine\Data\SqlDataProvider.cs替换5000为3000
3. Rebuild
--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
2. \Engine\Data\SqlDataProvider.cs替换5000为3000
3. Rebuild
解决方案 »
- 怎么在OnKeyPress中获取中文输入法的完整字符
- 急!!求一个很多Radiobutton投票的思路
- winform 控件 集合编辑器
- C# TreeView如何展开当前节点的所有下级节点
- 初学 ASP .NET 连接数据库的问题
- DevExpress XtraBars的工具栏怎么使用背景图片?
- Socket,HttpWebRequest,WebClient哪种方法下载网页的速度快
- 求助:无法找到脚本库“/aspnet_client;System_web/1_1_4322/WebUIValidation.js”。怎么解决!?
- listView1简单问题
- 各位大虾,如何实现这样的功能?
- 〓〓◆〓〓发现浏览论坛的好东西!
- DataSet 的Update()! 我今天喝了点酒,本来这个问题我都不敢在问了!
www.asp.net我也找过,可惜英语水平太差,只能靠金山词霸帮助,读起来非常吃力。
后悔吗?说真的,至今还没有人愿意收我。
如果你愿意的话,我会挺开心的,呵呵。
你有很多地方值得我学习。