0

Hi everyone,

I have made a script which logs the users ip into a table.
Here is the table:

ID - PKEY A.INC
IP - VARCHAR
ENTERED - TIMESTAMP

What I would like to happen is that after a row has been inserted, I want to set up a sql JOB, to automatically tjeck this table for rows which are >= 24 hours old, and if found, then delete the row.

Or if it is easier to create: If time is 00.00 then delete all records in the table, that could support my idea too :-)

It is for a voting system on a website.

The only thing is, that I have never been near creating a JOB in SQL, I have just stuck to SELECT, UPDATE, DELETE statements.

It is the very last thing I need for finishing my exam project, and I hope someone can be helpful.

Regards Klemme

Edited by klemme: n/a

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by klemme
0

Thanks pritaeas I will look into your links posted :-)

It not not after an insert, no user-action should be required for the deletion to happen.

So I suppose it should be an event, scheduled to run everyday at i.e. 00.00.

Edited by klemme: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.