Hi every one.
I really need help with WZ_DISCONNECT_MEMB.
The online exchange hours that i made it's not save previous record it's always reset to 0 when logout and login , even getting DC in game the online hours won't save any thing at all.
Thanks
I really need help with WZ_DISCONNECT_MEMB.
The online exchange hours that i made it's not save previous record it's always reset to 0 when logout and login , even getting DC in game the online hours won't save any thing at all.
Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
@memb___id varchar(10)
AS
Begin
set nocount on
Declare @find_id varchar(10)
Declare @ConnectStat tinyint
declare @OnlineHours int
Set @ConnectStat = 0
Set @find_id = 'NOT'
select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id
where I.memb___id = @memb___id
if( @find_id <> 'NOT' )
begin
update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = (DATEDIFF(mi,ConnectTM,getdate()))
where memb___id = @memb___id
end
end