Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. USE [Db_Tank36]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[SP_Users_Active] Script Date: 28-Feb-20 7:09:44 PM ******/
  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. @Site nvarchar(200)
  40. as
  41. declare @count int
  42.  
  43. select @count= isnull(count(*),0) from Sys_Users_Detail where UserName = @UserName and ServerID = @ServerID
  44.  
  45. if @count <> 0
  46. begin
  47. return 1
  48. end
  49.  
  50. set xact_abort on
  51. begin tran
  52.  
  53. 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)
  54. --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')
  55. 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',4)
  56.  
  57. if @@error <> 0
  58. begin
  59. rollback tran
  60. return @@error
  61. end
  62.  
  63. select @UserID = isnull(@@IDENTITY ,0)
  64.  
  65. if @UserID = 0
  66. begin
  67. rollback tran
  68. return 1
  69. end
  70.  
  71. insert into Sys_Users_Fight(UserID,Attack,Defence,Luck,Agility,MagicAttack,MagicDefence,evolutionGrade,evolutionExp,[Delay],Honor,Map,Directory,IsExist)
  72. values(@UserID,@Attack,@Defence,@Luck,@Agility,0,0,1,0,0,'','','',1)
  73.  
  74. if @@error<>0
  75. begin
  76. rollback tran
  77. return @@error
  78. end
  79.  
  80. INSERT INTO [Sys_VIP_Info]([UserID])
  81. VALUES(@UserID)
  82.  
  83. if @@error<>0
  84. begin
  85. rollback tran
  86. return @@error
  87. end
  88.  
  89. INSERT INTO [Sys_Users_Texp]([UserID])
  90. VALUES(@UserID)
  91.  
  92. if @@error<>0
  93. begin
  94. rollback tran
  95. return @@error
  96. end
  97.  
  98. insert into [dbo].[DailyLogList]([UserID])
  99. values(@UserID)
  100.  
  101. if @@error<>0
  102. begin
  103. rollback tran
  104. return @@error
  105. end
  106.  
  107. --Declare @Index Int
  108. --Declare @type Int
  109. --Set @Index = 0
  110. --Set @type = 0
  111. --While @Index < 5
  112. -- Begin
  113. -- If @Index = 0
  114. -- Begin
  115. -- Set @type = 1
  116. -- End
  117. -- Else
  118. -- Begin
  119. -- Set @type = 0
  120. -- End
  121. -- INSERT INTO [Sys_Users_Card]([UserID],[Place])
  122. -- VALUES(@UserID,@Index)
  123. -- Set @Index = @Index+1
  124. -- End
  125.  
  126. if @@error<>0
  127. begin
  128. rollback tran
  129. return @@error
  130. end
  131.  
  132. commit tran
  133. set xact_abort off
  134. return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement