SHARE
TWEET

Untitled

a guest Dec 29th, 2016 118 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. EXECUTE AS USER = 'user_1';
  2.  
  3. CREATE LOGIN        test@test
  4.     WITH PASSWORD = '123456'
  5.     , DEFAULT_DATABASE = my_database
  6.     , CHECK_POLICY = OFF
  7.     , CHECK_EXPIRATION = OFF;
  8.  
  9. CREATE USER         test@test
  10.     FOR LOGIN       test@test;
  11.    
  12. CREATE PROCEDURE        users.usp_newUser
  13.                         (
  14.                             @email          VARCHAR(254)
  15.                             , @firstName    VARCHAR(35)
  16.                             , @lastName     VARCHAR(35)
  17.                             , @password     CHAR(88)
  18.                             , @salt         VARCHAR(MAX)
  19.                             , @isSuccess    BIT OUT
  20.                         )
  21. AS
  22. BEGIN
  23.  
  24.     SET                 @isSuccess = 1;
  25.  
  26.     SET NOCOUNT ON;
  27.  
  28.     EXECUTE AS USER = 'user_1';
  29.  
  30.     EXECUTE             users.usp_newUserForPrivilege
  31.                             @email
  32.                             , @firstName
  33.                             , @lastName
  34.                             , @password
  35.                             , @salt
  36.                             , @isSuccess;
  37.  
  38.     RETURN;
  39.  
  40. END;
  41. GO
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top