[help] Sql Script @ Ways To Delete Char..

Newbie Spellweaver
Joined
Apr 15, 2008
Messages
20
Reaction score
0
Hello fellow ragezoners...
I'm a seasoned 'reader' of the forum, but a noob in asking for help. Something has been bugging me for quite a long time & perhaps this time I cud ask all of u a favor.

My server have like 17k user & abt 20k char (since I allowed 3 char per id). The porblem is, as players come & go, how do I delete the id ALONG WITH THE CHARACTERS. Since from my trial, I found out that even after I deleted the ID, the char database still remains & clogs the server.

I deleted abt 2k of IDs & their char by reffering to GMCharEdit. As crazy as it may sound, I decided I need help, so...please everyone. Thx in advance.
 
Umm...yup. I already read that. BUT, that wud only delete the ID/account, while leaving the character database in rangame1/charinfo bloated still crowded with char accounts.

I rephrase my request...I want to delete innactive player acc, while in the mean time, it also clears the character(s) that the player have.

Thx.
 
Upvote 0
We used this trigger to delete characters in the database ( where its already deleted in-game ).

Make backup first though :

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER [dbo].[Cha_deleted] ON [dbo].[ChaInfo]
after update
as
BEGIN

DELETE FROM [RanGame1].[dbo].[ChaInfo]
WHERE Chadeleted = 1


END
 
Upvote 0
I dun quite get it...do u mean that trigger is for "deleting deleted char?" Coz if it is, I am using it for the char that has been deleted, but their account still fills up the database.

Hmm...sounds complicated huh? Is there a way to link each account to their char(s), & when we delete each inactive account/ id, all char in that id will be deleted as well. I believe the trigger U shared is for the char that has been deleted by the user. But I need something else.

Wish there is an easier way to describe this...
 
Upvote 0
what about for the auto deletion of inactive accounts where should i execute it and could you please give me a working...on SQL Trigger Script Collection Page i tested all the auto deletion of inactive accounts scripts but it gives me error...
 
Upvote 0
Yes...sort of it but not quite.

Like if the player is inactive, then the autodelete will remove his acc. But if the player managed to create a char before that, his char will remain in the database.

I dun know if anybody notice this, but I found many char without account in my rangame1.

Auto deletion only delete account.
Delete deleted char only delete char that HAS BEEN DELETED by the player themselves.

How to delete the innactive account...then it also, auto delete the character(s) under that account.

My question remains unanswered....
 
Upvote 0
We used this trigger to delete characters in the database ( where its already deleted in-game ).

Make backup first though :

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER [dbo].[[COLOR="Red"]Cha_deleted[/COLOR]] ON [dbo].[ChaInfo]
after update
as
BEGIN

DELETE FROM [RanGame1].[dbo].[ChaInfo]
WHERE Chadeleted = 1


END

Is it Chadeleted and not Cha_deleted?
 
Upvote 0
Trigger for deleting deleted characters :

Open your RanGame1 Databse > New Query > Execute this script !
Code:
USE RANGAME1
DELETE FROM Chainfo where ChaDeleted = 1

This is from heavenzel's script.

Auto Deletion of In-Active Account :

Code:
 DELETE FROM [UserInfo] WHERE DATEDIFF(day,[UserInfo].LastLoginDate, GETDATE()) >= 30

This is 30 days inactive account. Just change the number to whatever you like.

@ cruzades - Thats the script on my trigger.
 
Upvote 0
Back