Hello
How store the ip of the players in sql 2005 ?
Printable View
Hello
How store the ip of the players in sql 2005 ?
Here:
Luck!PHP Code:USE SRO_VT_SHARD
DECLARE @charname VARCHAR(16),@JID INT
SET @charname = 'CHAR'
SET @JID = (SELECT userJID FROM _User WHERE CharID=(SELECT CharID FROM _Char WHERE CharName16 = @charname))
USE SRO_VT_ACCOUNT SELECT reg_ip FROM TB_User WHERE JID =@JID
thx man but not this what i want
i want store the ip of the all players like this http://forum.ragezone.com/f722/chara...ban-ip-889849/
but in sql 2005
I then used the thread. :ehh:
this thread for sql 2008 i want for sql 2005 :(
up up
you can easily use the sql statements from the thread you linked .. all you have to do is put variable initialization to a new line and use 1 line for every variable declaration .. for example:
this:
you would need to change to:PHP Code:DECLARE
@ID VARCHAR(64) = (Select STRuserID FROM TB_User Where JID = @AccJID),
@Begin DATETIME = GETDATE()-1,
@End DATETIME = GETDATE()+3650
do this with all variable declarations/initializations and the queries will work in 2005 tooPHP Code:DECLARE @ID VARCHAR(64)
SET @ID = (Select STRuserID FROM TB_User Where JID = @AccJID)
DECLARE @Begin DATETIME
SET @Begin = GETDATE()-1
DECLARE @End DATETIME
SET @End = GETDATE()+3650
thx lemoniscool
can you please make example for this :
PHP Code:USE [Log_DB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as
IF(@EventID = 4 OR @EventID = 6)
BEGIN
declare @len_pos int
declare @len_desc int
set @len_pos = len(@strPos)
set @len_desc = len(@Desc)
if (@len_pos > 0 and @len_desc > 0)
begin
insert _LogEventChar values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos, @Desc)
end
else if (@len_pos > 0 and @len_desc = 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, EventPos) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @strPos)
end
else if (@len_pos = 0 and @len_desc > 0)
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2, strDesc) values(@CharID, GetDate(), @EventID, @Data1, @Data2, @Desc)
end
else
begin
insert _LogEventChar (CharID, EventTime, EventID, Data1, Data2) values(@CharID, GetDate(), @EventID, @Data1, @Data2)
end
--For the new IPLog table
Declare @DynIP varchar(max);
exec @DynIP = SRO_VT_ACCOUNT.dbo.split_ip @Data2
INSERT INTO _IPLogs (CharID,Charname,IP,[Date]) VALUES (@CharID, (SELECT CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = @CharID),@DynIP,GETDATE())
-- END
END