title: Would like to execute a query once per day in ASP.NET MVC
body: <p>I would like my ASP.NET MVC app to execute a query once per day. What is the recommended way to do this?</p>
  
  <p>My first thought is to put a timer in Global.asax that goes off every 24 hours, then call my query from the <code>Elapsed</code> handler. Any pitfalls with doing it this way? Is there a better way?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Let me add a little detail to what I'm trying to do. I'd specifically like the query to execute at midnight every day. If a day is missed (say due to sever maintenance or upgrading the app), that wouldn't be a major issue.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Couple more details:</p>
  
  <ol>
  <li>The query is actually an INSERT, not a SELECT. The purpose is to add a "renewal" record for any member that is due to renew his/her membership at the end of the month.</li>
  <li>I'm using SQL Server Compact (it's a very small database).</li>
  </ol>