Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE [Db_Tank36]
- GO
- /****** Object: StoredProcedure [dbo].[SP_Users_Active] Script Date: 28-Feb-20 7:09:44 PM ******/
- SET ANSI_NULLS ON
- GO
- SET QUOTED_IDENTIFIER ON
- GO
- -- =============================================
- -- Author: <Ken>
- -- ALTER date: <2009-10-22>
- -- Description: <用户信息:激活用户>
- -- =============================================
- ALTER Procedure [dbo].[SP_Users_Active]
- @UserID int out,
- @Attack int,
- @Colors Nvarchar(200),
- @ConsortiaID int,
- @Defence int,
- @Gold int,
- @GP int,
- @Grade int,
- @Luck int,
- @Money int,
- @Style Nvarchar(200),
- @Agility int,
- @State int,
- @UserName Nvarchar(200),
- @PassWord Nvarchar(200),
- @Sex bit,
- @Hide int,
- @ActiveIP Nvarchar(50),
- @Skin Nvarchar(500),
- @Site nvarchar(200)
- as
- declare @count int
- select @count= isnull(count(*),0) from Sys_Users_Detail where UserName = @UserName and ServerID = @ServerID
- if @count <> 0
- begin
- return 1
- end
- set xact_abort on
- begin tran
- 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)
- --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')
- 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)
- if @@error <> 0
- begin
- rollback tran
- return @@error
- end
- select @UserID = isnull(@@IDENTITY ,0)
- if @UserID = 0
- begin
- rollback tran
- return 1
- end
- insert into Sys_Users_Fight(UserID,Attack,Defence,Luck,Agility,MagicAttack,MagicDefence,evolutionGrade,evolutionExp,[Delay],Honor,Map,Directory,IsExist)
- values(@UserID,@Attack,@Defence,@Luck,@Agility,0,0,1,0,0,'','','',1)
- if @@error<>0
- begin
- rollback tran
- return @@error
- end
- INSERT INTO [Sys_VIP_Info]([UserID])
- VALUES(@UserID)
- if @@error<>0
- begin
- rollback tran
- return @@error
- end
- INSERT INTO [Sys_Users_Texp]([UserID])
- VALUES(@UserID)
- if @@error<>0
- begin
- rollback tran
- return @@error
- end
- insert into [dbo].[DailyLogList]([UserID])
- values(@UserID)
- if @@error<>0
- begin
- rollback tran
- return @@error
- end
- --Declare @Index Int
- --Declare @type Int
- --Set @Index = 0
- --Set @type = 0
- --While @Index < 5
- -- Begin
- -- If @Index = 0
- -- Begin
- -- Set @type = 1
- -- End
- -- Else
- -- Begin
- -- Set @type = 0
- -- End
- -- INSERT INTO [Sys_Users_Card]([UserID],[Place])
- -- VALUES(@UserID,@Index)
- -- Set @Index = @Index+1
- -- End
- if @@error<>0
- begin
- rollback tran
- return @@error
- end
- commit tran
- set xact_abort off
- return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement