Junior Spellweaver
- Joined
- Jan 1, 2008
- Messages
- 170
- Reaction score
- 0
add this table under RanGame1
Column Name: LastLoginDate
Data Type: datetime
Allow Nulls: Yes
Next is to create this trigger, make a new query and paste this script:
i've just added some of this existing script found in ragezone.. tnx
Column Name: LastLoginDate
Data Type: datetime
Allow Nulls: Yes
Next is to create this trigger, make a new query and paste this script:
if you have an existing trigger in rangame1 under chainfo.. then insert only this script before ENDUSE [RanGame1]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[Delete_Char] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].LastLoginDate = GETDATE()
From inserted
Where Inserted.ChaOnline = 1
and Inserted.ChaNum = [ChaInfo].ChaNum
Delete from [ChaInfo]
Where DATEDIFF(day,[ChaInfo].LastLoginDate,GETDATE()) >= 30 -----You can change this to number of days you want
END
Update [ChaInfo] set [ChaInfo].LastLoginDate = GETDATE()
From inserted
Where Inserted.ChaOnline = 1
and Inserted.ChaNum = [ChaInfo].ChaNum
Delete from [ChaInfo]
Where DATEDIFF(day,[ChaInfo].LastLoginDate,GETDATE()) >= 30 -----You can change this to number of days you want
i've just added some of this existing script found in ragezone.. tnx
Last edited: