In my application, I want the user to be able to retrieve deleted information within one month.
Create Table 'Names' (name varchar(20) primary key)
Create Table 'DeletedNames'
name varchar(20) primary key,
insertingTime DateTime not null
| Mohammed | | 2017-6-11 10:00 PM |
You don't need a trigger. Just set up an agent job with the delete statement. Schedule it to run every day.
DELETE FROM DeletedNames WHERE InsertingTime < DATEADD(day,-30,GETDATE())
In MySQL use the Event Scheduler.