1ALTER PROCEDURE dbo.aspnet_Membership_GetPasswordWithFormat
2 @ApplicationName NVARCHAR(256),
3 @UserName NVARCHAR(256)
4AS
5BEGIN
6 DECLARE @Password NVARCHAR(128)
7 DECLARE @PasswordFormat INT
8 DECLARE @PasswordSalt NVARCHAR(128)
9 DECLARE @IsLockedOut BIT
10 DECLARE @FailedPasswordAttemptCount INT
11 DECLARE @FailedPasswordAnswerAttemptCount INT
12 DECLARE @IsApproved BIT
13 /*又是声明一大堆变量,*/
14
15
16 SELECT @Password = m.Password,
17 @PasswordFormat = m.PasswordFormat,
18 @PasswordSalt = m.PasswordSalt,
19 @IsLockedOut = m.IsLockedOut,
20 @FailedPasswordAttemptCount = m.FailedPasswordAttemptCount,
21 @FailedPasswordAnswerAttemptCount = m.FailedPasswordAnswerAttemptCount,
22 @IsApproved = m.IsApproved
23 FROM dbo.aspnet_Applications a, dbo.aspnet_Users u, dbo.aspnet_Membership m
24 WHERE LOWER(@ApplicationName) = a.LoweredApplicationName AND
25 u.ApplicationId = a.ApplicationId AND
26 u.UserId = m.UserId AND
27 LOWER(@UserName) = u.LoweredUserName
28 /*三表连接,附加条件为@ApplicationName/@UserName*/
29
30 IF( @@rowcount = 0 )--如果受影响行数为0
31 RETURN 1
32
33 IF( @IsLockedOut = 1 ) --如果用户已经被锁定
34 RETURN 99
35
36 SELECT @Password,
37 @PasswordFormat,
38 @PasswordSalt,
39 @FailedPasswordAttemptCount,
40 @FailedPasswordAnswerAttemptCount,
41 @IsApproved
42 /*查询想要的字段,返回0*/
43 RETURN 0
44END
2 @ApplicationName NVARCHAR(256),
3 @UserName NVARCHAR(256)
4AS
5BEGIN
6 DECLARE @Password NVARCHAR(128)
7 DECLARE @PasswordFormat INT
8 DECLARE @PasswordSalt NVARCHAR(128)
9 DECLARE @IsLockedOut BIT
10 DECLARE @FailedPasswordAttemptCount INT
11 DECLARE @FailedPasswordAnswerAttemptCount INT
12 DECLARE @IsApproved BIT
13 /*又是声明一大堆变量,*/
14
15
16 SELECT @Password = m.Password,
17 @PasswordFormat = m.PasswordFormat,
18 @PasswordSalt = m.PasswordSalt,
19 @IsLockedOut = m.IsLockedOut,
20 @FailedPasswordAttemptCount = m.FailedPasswordAttemptCount,
21 @FailedPasswordAnswerAttemptCount = m.FailedPasswordAnswerAttemptCount,
22 @IsApproved = m.IsApproved
23 FROM dbo.aspnet_Applications a, dbo.aspnet_Users u, dbo.aspnet_Membership m
24 WHERE LOWER(@ApplicationName) = a.LoweredApplicationName AND
25 u.ApplicationId = a.ApplicationId AND
26 u.UserId = m.UserId AND
27 LOWER(@UserName) = u.LoweredUserName
28 /*三表连接,附加条件为@ApplicationName/@UserName*/
29
30 IF( @@rowcount = 0 )--如果受影响行数为0
31 RETURN 1
32
33 IF( @IsLockedOut = 1 ) --如果用户已经被锁定
34 RETURN 99
35
36 SELECT @Password,
37 @PasswordFormat,
38 @PasswordSalt,
39 @FailedPasswordAttemptCount,
40 @FailedPasswordAnswerAttemptCount,
41 @IsApproved
42 /*查询想要的字段,返回0*/
43 RETURN 0
44END