才注释了几个就感觉有点烦烦的了,好象需要耐心的样子.不过吃过午饭好象有可以了.很多地方都没说清楚,希望看的人不要被我误导了,所以要抱着参考的态度看.
1
ALTER PROCEDURE dbo.aspnet_Membership_GetUserByUserId --通过用户ID获取用户
2
@UserId UNIQUEIDENTIFIER,
3
@TimeZoneAdjustment INT,
4
@UpdateLastActivity BIT = 0
5
AS
6
BEGIN
7
IF ( @UpdateLastActivity = 1 )
8
BEGIN
9
DECLARE @DateTimeNowUTC DATETIME
10
EXEC dbo.aspnet_GetUtcDate @TimeZoneAdjustment, @DateTimeNowUTC OUTPUT
11
UPDATE dbo.aspnet_Users
12
SET LastActivityDate = @DateTimeNowUTC
13
FROM dbo.aspnet_Users
14
WHERE @UserId = UserId
15![](/Images/OutliningIndicators/None.gif)
16
IF ( @@ROWCOUNT = 0 ) -- User ID not found
17
RETURN -1
18
END
19
/*还是更新用户最近活动时间的,是某个用户的,ID为条件*/
20
SELECT m.Email, m.PasswordQuestion, m.Comment, m.IsApproved,
21
m.CreateDate, m.LastLoginDate, u.LastActivityDate,
22
m.LastPasswordChangedDate, u.UserName, m.IsLockedOut,
23
m.LastLockoutDate
24
FROM dbo.aspnet_Users u, dbo.aspnet_Membership m
25
WHERE @UserId = u.UserId AND u.UserId = m.UserId
26
/*这里好象就两个表连接,不知道为什么*/
27
IF ( @@ROWCOUNT = 0 ) -- User ID not found
28
RETURN -1
29![](/Images/OutliningIndicators/None.gif)
30
RETURN 0
31
END
32![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/None.gif)
11
![](/Images/OutliningIndicators/None.gif)
12
![](/Images/OutliningIndicators/None.gif)
13
![](/Images/OutliningIndicators/None.gif)
14
![](/Images/OutliningIndicators/None.gif)
15
![](/Images/OutliningIndicators/None.gif)
16
![](/Images/OutliningIndicators/None.gif)
17
![](/Images/OutliningIndicators/None.gif)
18
![](/Images/OutliningIndicators/None.gif)
19
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
20
![](/Images/OutliningIndicators/None.gif)
21
![](/Images/OutliningIndicators/None.gif)
22
![](/Images/OutliningIndicators/None.gif)
23
![](/Images/OutliningIndicators/None.gif)
24
![](/Images/OutliningIndicators/None.gif)
25
![](/Images/OutliningIndicators/None.gif)
26
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
27
![](/Images/OutliningIndicators/None.gif)
28
![](/Images/OutliningIndicators/None.gif)
29
![](/Images/OutliningIndicators/None.gif)
30
![](/Images/OutliningIndicators/None.gif)
31
![](/Images/OutliningIndicators/None.gif)
32
![](/Images/OutliningIndicators/None.gif)