Click here to Skip to main content
14,328,713 members
Rate this:
Please Sign up or sign in to 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.
Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100