Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[UMG_LOGIN]
  2. @AccountID varchar( 21),
  3. @Password varchar(32),
  4. @nRet smallint OUTPUT
  5. AS
  6. DECLARE @pwd varchar(32), @Authority int
  7. BEGIN
  8.  
  9. -- <RETRIEVE ACCOUNT DATA>
  10. SELECT @pwd = strPasswd, @Authority = strAuthority FROM TB_USER WHERE strAccountID = @AccountID
  11. -- </RETRIEVE ACCOUNT DATA>
  12.  
  13. -- <ACCOUNT DOES NOT EXIST>
  14. IF @@ROWCOUNT = 0
  15. BEGIN
  16. SET @nRet = 0
  17. RETURN
  18. END
  19. -- </ACCOUNT DOES NOT EXIST>
  20.  
  21. -- <NOT A 'GM'> [SET strAuthority TO 0]
  22. IF @Authority <> 0
  23. BEGIN
  24. SET @nRet = 0
  25. RETURN
  26. END
  27. -- </NOT A 'GM'>
  28.  
  29. -- <EMPTY PASSWORD>
  30. ELSE IF @pwd IS NULL
  31. BEGIN
  32. SET @nRet = 0
  33. RETURN
  34. END
  35. -- </EMPTY PASSWORD>
  36.  
  37. -- <INVALID PASSWORD>
  38. ELSE IF @pwd <> @Password
  39. BEGIN
  40. SET @nRet = 0
  41. RETURN
  42. END
  43. -- </INVALID PASSWORD>
  44.  
  45. SET @nRet = 1
  46. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement