title: how do I create a stored procedure to delete all records in a table prior to a specific date?
body: <p>I need to create a stored procedure that will clear our log file after a certain amount of time back from the current date.</p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/7603817/delete-records-based-on-dates">this post</a> but I'm not familiar enough with tsql to adjust it.</p>
  
  <pre><code>    USE SuburbanPortal;
      GO
  
      CREATE PROCEDURE sp_ClearWebLogTable
  
      DELETE FROM Web.Log WHERE 
          (date &gt; GETDATE() AND date &lt;  DATEADD(day, 5, GETDATE()));
      GO
  </code></pre>
  
  <p>I did adjust it for my table and database but I need to clear the log, daily, of anything more than a month old.</p>
  
  <p>Any help would be greatly appreciated!</p>