Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hai,

I need to truncate table automatically after a particular time.Can any one pls tell me any good solution for this problem.Thanks in Advance.
Posted
Comments
Amir Mahfoozi 4-Feb-12 1:39am    
Which table ? in which platform ?
Gopinath1005 4-Feb-12 1:45am    
in sql???
Member 8615092 4-Feb-12 1:47am    
In need to truncate table in asp.net in code behind.
ZurdoDev 4-Feb-12 21:23pm    
ASP.Net code behind is a web app and is not constantly running. It runs when someone browses to your site. So, for example, you could use global.asax and use either the Application_start event or the Session_Start event and call a stored procedure. Or, you an just create a SQL job and have it run whenever you want.

Your asp.net does not contain a table, your SQL Server does. As others have said, ASP.NET doesn't have any code that runs constantly. I would look at setting up jobs inside SQL Server, or you could write a windows service that responds to a timeout to perform your task.
 
Share this answer
 
 
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