Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[UMG_LOGIN]
- @AccountID varchar( 21),
- @Password varchar(32),
- @nRet smallint OUTPUT
- AS
- DECLARE @pwd varchar(32), @Authority int
- BEGIN
- -- <RETRIEVE ACCOUNT DATA>
- SELECT @pwd = strPasswd, @Authority = strAuthority FROM TB_USER WHERE strAccountID = @AccountID
- -- </RETRIEVE ACCOUNT DATA>
- -- <ACCOUNT DOES NOT EXIST>
- IF @@ROWCOUNT = 0
- BEGIN
- SET @nRet = 0
- RETURN
- END
- -- </ACCOUNT DOES NOT EXIST>
- -- <NOT A 'GM'> [SET strAuthority TO 0]
- IF @Authority <> 0
- BEGIN
- SET @nRet = 0
- RETURN
- END
- -- </NOT A 'GM'>
- -- <EMPTY PASSWORD>
- ELSE IF @pwd IS NULL
- BEGIN
- SET @nRet = 0
- RETURN
- END
- -- </EMPTY PASSWORD>
- -- <INVALID PASSWORD>
- ELSE IF @pwd <> @Password
- BEGIN
- SET @nRet = 0
- RETURN
- END
- -- </INVALID PASSWORD>
- SET @nRet = 1
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement