Click here to Skip to main content
15,918,617 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone to solve my problem.
how to automatically delete data from data base after some days or 65 days.
Posted
Comments
Sushil Mate 28-Mar-12 2:23am    
what database you have?
nj15 28-Mar-12 2:33am    
create a stored procedure in your database

1 solution

That depends a little on the specifications, the size of the database etc...
Also do you want to permanently delete the data or move them to a history table?
Have a look at "cascading".

You can create a scheduled task that executes an SQL file via a bat file that does some clean up or alternatively you may want to write a configurable application.
Another option is to do a check inside your application when it is running and assign a background thread for example to clean up in case it is necessary. (that does mean your application needs to be running regularly and you need a good point in your application to place and check this)

Do you want to check each 65 days and delete all or do you want to check each day and delete everything older then 65 days?

I suggest you contemplate a little more on what you want to achieve and come back here with more specific issues.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900