title: Use computed column or stored procedure
body: <p>I have a table with a few columns that are used as <code>datetime</code> stamps. The table contains the following columns</p>
  
  <pre><code>UpDate      datetime
  SearchDate  datetime
  ExpDate     dateadd(hour,24,UpDate)
  Active      nvarchar(5)
  </code></pre>
  
  <p>When the <code>UpDate</code> column is updated by the daily import the computed column <code>ExpDate</code> will be updated with the time + 24 hours. I would like the <code>Active</code> column to indicate <code>'Y'</code> when the current datetime is less than the <code>ExpDate</code> and <code>'N'</code> when the current datetime is equal to or more than the <code>ExpDate</code>.</p>
  
  <p>I thought of just using a stored procedure to run indefinitely to check this and update as needed but that does not make sense to do and would like to know if anyone has any other suggestions on how to do this. For example if I can use that as a computed column as well based on an IF statement query.</p>