Click here to Skip to main content
15,886,872 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
how to delete data before 7 or 8 days from sqldatabase in asp.net with C#.
Posted
Comments
[no name] 1-Dec-11 8:42am    
did you mean, you need an application that will run and delete records from database every 7-8 days? please rephrase your question.
[no name] 1-Dec-11 9:05am    
no i want to delete data from sql data base table before 7 or 8 daye because i store the login information data then data is very large within 7-8 days so i want to delete old data in asp.net code with C#.
Riaan Booyzen 1-Dec-11 8:51am    
why do you need to delete all your data?
#realJSOP 1-Dec-11 8:59am    
Why does it matter to you? He's asking how to do it, not if you approve.
[no name] 1-Dec-11 9:06am    
i want to delete data from sql data base table before 7 or 8 daye because i store the login information data then data is very large within 7-8 days so i want to delete old data in asp.net code with C# not all data from the table.

Something like this:

SQL
DELETE FROM tablename WHERE DATEDIFF(day, GETDATE(), tablename.DateColumnName) > 7
 
Share this answer
 
Comments
[no name] 1-Dec-11 9:29am    
how to get date diffrence.
#realJSOP 1-Dec-11 9:38am    
It's right there in my answer. READ IT.
[no name] 1-Dec-11 10:25am    
thanks, i like your answer...
[no name] 1-Dec-11 17:41pm    
my 5.
 
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