Quote:
Originally Posted by NorseGodTyr
Next time write it yourself queries and procedures are not hard to write
If you open or have a server, you have to learn how to do it yourself and not always ask. or do you always want to ask for a release etc?
So that it is not that easy, I have made some small mistakes in the procedure. You have to find them yourself
example
---------------------------------------------------------------------------------------
Procedure for shardlog _addLogChar
---------------------------------------------------------------------------------------
---BA Start
IF @  D = 239 and @  = 1 or @  D = 239 and @  = 3 or @  D = 239 and @  = 8)
Begin
DECLARE @  JID int @  countID varchar(500) @  gIP varchar(500)
DECLARE @  Name VARCHAR(52) = (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @  D)
select @  JID = UserJID from SRO_VT_SHARD.dbo._User where CharID = @  D
Set @  countID = (select AccountID from SRO_VT_SHARD.dbo._AccountJID where JID = @  JID)
SELECT @  gIP = [login_ip] FROM SRO_VT_ACCOUNT.dbo.TB_User WHERE StrUserID = @  countID
IF EXISTS (SELECT * FROM [SRO_VT_SHARDLOG].[dbo].[_BattleArena] WHERE [RegIP] = @  gIP)
Begin
--paste here a Disconnect command [Use a tool that disconnects a player]
End
ELSE IF NOT EXISTS (SELECT * FROM [SRO_VT_SHARDLOG].[dbo].[_BattleArena] WHERE [RegIP] = @  gIP)
Begin
INSERT INTO [SRO_VT_SHARDLOG].[dbo].[_BattleArena] ([UserName],[CharID],[CharName],[RegIP]) VALUES @  countID @  D @  Name @  gIP)
-- Added username / CharId / Character Name / ip
End
End
IF @  D = 239 and @  = 4 or @  D = 239 and @  = 5)
Begin
TRUNCATE TABLE [SRO_VT_SHARDLOG].[dbo].[_BattleArena]
-- Clean Table
End
---BA End
---------------------------------------------------------------------------------------
Table
---------------------------------------------------------------------------------------
USE [SRO_VT_SHARDLOG]
GO
/****** Object: Table [dbo].[_BattleArena] Script Date: 30.06.2020 12:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[_BattleArena](
[UserName] [varchar](max) NULL,
[CharID] [int] NULL,
[CharName] [varchar](max) NULL,
[RegIP] [varchar](max) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
|
give error
Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 338 [Batch Start Line 7]
Incorrect syntax near ')'.
Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 340 [Batch Start Line 7]
Incorrect syntax near '@baaccountID'.
Msg 137, Level 15, State 1, Procedure _AddLogChar, Line 342 [Batch Start Line 7]
Must declare the scalar variable "@bauserJID".
Msg 137, Level 15, State 2, Procedure _AddLogChar, Line 343 [Batch Start Line 7]
Must declare the scalar variable "@bauserJID".
Msg 137, Level 15, State 1, Procedure _AddLogChar, Line 344 [Batch Start Line 7]
Must declare the scalar variable "@BaregIP".
Msg 137, Level 15, State 2, Procedure _AddLogChar, Line 345 [Batch Start Line 7]
Must declare the scalar variable "@BaregIP".
Msg 137, Level 15, State 2, Procedure _AddLogChar, Line 351 [Batch Start Line 7]
Must declare the scalar variable "@BaregIP".
Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 353 [Batch Start Line 7]
Incorrect syntax near '@baaccountID'.
Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 357 [Batch Start Line 7]
Incorrect syntax near ')'.
Msg 102, Level 15, State 1, Procedure _AddLogChar, Line 361 [Batch Start Line 7]
Incorrect syntax near 'End'.