Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. SET ANSI_NULLS ON
  2. GO
  3. SET QUOTED_IDENTIFIER ON
  4. GO
  5.  
  6. CREATE PROCEDURE createAccount
  7.  
  8. @username char(20),
  9. @email char(50),
  10. @password char(20),
  11. @verified BIT,
  12. @enabled BIT,
  13. @verificationCode char(8),
  14.  
  15. @class TINYINT,
  16. @gender char (6)
  17.  
  18. AS
  19.  
  20. BEGIN TRY
  21.  
  22. BEGIN TRANSACTION
  23.  
  24.  
  25.  
  26. INSERT INTO Accounts ([username], [email], [password], [verified?], [enabled?], [verificationCode])
  27. VALUES (@username, @email, @password, @verified, @enabled, @verificationCode)
  28.  
  29. INSERT INTO Characters([doingSomething?], [class], [gender])
  30. VALUES (@username, @email, @password, @verified, @enabled, @verificationCode)
  31.  
  32. END TRY
  33. BEGIN CATCH
  34.  
  35. IF @@TRANCOUNT>0
  36. ROLLBACK
  37.  
  38. END CATCH
  39. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement