Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. USE [Db_Tank36]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[SP_Users_Active] Script Date: 28/02/2020 15:50:47 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. -- =============================================
  15. -- Author: <Ken>
  16. -- ALTER date: <2009-10-22>
  17. -- Description: <用户信息:激活用户>
  18. -- =============================================
  19. ALTER Procedure [dbo].[SP_Users_Active]
  20. @UserID int out,
  21. @Attack int,
  22. @Colors Nvarchar(200),
  23. @ConsortiaID int,
  24. @Defence int,
  25. @Gold int,
  26. @GP int,
  27. @Grade int,
  28. @Luck int,
  29. @Money int,
  30. @Style Nvarchar(200),
  31. @Agility int,
  32. @State int,
  33. @UserName Nvarchar(200),
  34. @PassWord Nvarchar(200),
  35. @Sex bit,
  36. @Hide int,
  37. @ActiveIP Nvarchar(50),
  38. @Skin Nvarchar(500),
  39. @MagicAttack int,
  40. @MagicDefence int,
  41. @evolutionGrade int,
  42. @evolutionExp int,
  43. @Site nvarchar(200),
  44. @ServerID int
  45. as
  46. declare @count int
  47.  
  48. select @count= isnull(count(*),0) from Sys_Users_Detail where UserName = @UserName and ServerID = ServerID
  49.  
  50. if @count <> 0
  51. begin
  52. return 1
  53. end
  54.  
  55. set xact_abort on
  56. begin tran
  57.  
  58. insert into Sys_Users_Detail(UserName,[PassWord],NickName,[Date],IsConsortia,ConsortiaID,Sex,Win,Total,[Escape],GP,Honor,Gold,[Money],Style,Colors,Hide,Grade,State,IsFirst,Repute,ActiveIP,IsExist,Skin,Site,PvePermission,ServerID)
  59. --values(@UserName,@PassWord,'',getdate(),0,0,@Sex,0,0,0,@GP,'',0,0,@Style,@Colors,@Hide,@Grade,@State,0,0,@ActiveIP,1,@Skin,@Site,'FFFFFFFFFFFFFFFFF')
  60. values(@UserName,@PassWord,'',getdate(),0,0,@Sex,0,0,0,@GP,'',@Gold,@Money,@Style,@Colors,@Hide,@Grade,@State,0,0,@ActiveIP,1,@Skin,@Site,'FFFFFFFFFFFFFFFFF',@ServerID)
  61.  
  62. if @@error <> 0
  63. begin
  64. rollback tran
  65. return @@error
  66. end
  67.  
  68. select @UserID = isnull(@@IDENTITY ,0)
  69.  
  70. if @UserID = 0
  71. begin
  72. rollback tran
  73. return 1
  74. end
  75.  
  76. insert into Sys_Users_Fight(UserID,Attack,Defence,Luck,Agility,MagicAttack,MagicDefence,evolutionGrade,evolutionExp,[Delay],Honor,Map,Directory,IsExist)
  77. values(@UserID,@Attack,@Defence,@Luck,@Agility,@MagicAttack,@MagicDefence,@evolutionGrade,@evolutionExp,0,'','','',1)
  78.  
  79. if @@error<>0
  80. begin
  81. rollback tran
  82. return @@error
  83. end
  84.  
  85. INSERT INTO [Sys_VIP_Info]([UserID])
  86. VALUES(@UserID)
  87.  
  88. if @@error<>0
  89. begin
  90. rollback tran
  91. return @@error
  92. end
  93.  
  94. INSERT INTO [Sys_Users_Texp]([UserID])
  95. VALUES(@UserID)
  96.  
  97. if @@error<>0
  98. begin
  99. rollback tran
  100. return @@error
  101. end
  102.  
  103. insert into [dbo].[DailyLogList]([UserID])
  104. values(@UserID)
  105.  
  106. if @@error<>0
  107. begin
  108. rollback tran
  109. return @@error
  110. end
  111.  
  112. --Declare @Index Int
  113. --Declare @type Int
  114. --Set @Index = 0
  115. --Set @type = 0
  116. --While @Index < 5
  117. -- Begin
  118. -- If @Index = 0
  119. -- Begin
  120. -- Set @type = 1
  121. -- End
  122. -- Else
  123. -- Begin
  124. -- Set @type = 0
  125. -- End
  126. -- INSERT INTO [Sys_Users_Card]([UserID],[Place])
  127. -- VALUES(@UserID,@Index)
  128. -- Set @Index = @Index+1
  129. -- End
  130.  
  131. if @@error<>0
  132. begin
  133. rollback tran
  134. return @@error
  135. end
  136.  
  137. commit tran
  138. set xact_abort off
  139. return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement