title: Pulling data from a SQL table
body: <p>I have an Intranet, that is SQL based on the back end.</p>
  
  <p>Users submit documents to the Intranet, but sometimes they set an expiry on the document.</p>
  
  <p>There is a table "dbo.article" that lists all these documents, who submitted them and when (if ever) they expire. I get get this data by doing:</p>
  
  <pre><code>SELECT TOP 999 [NEWSID]
    ,[EXPIRES]
    ,[HEADLINE]
    ,[AUTHORID]
    ,[AUTHOR]
     FROM [ARTICLE]
     ORDER BY [EXPIRES] ASC
  </code></pre>
  
  <p>I would like this to run, say once a week, and then email me when an article is about to expire.</p>
  
  <p>What would be the best way to achieve this?</p>
  
  <p>Gavin.</p>