title: Need to drop a list of tables and should be made configurable in SQL SERVER
body: <p>As a part of the new release, occasionally we take backups of few tables and then delete it over a stabilisation period.
  I want to make it configurable, that is have a naming convention set up for the list of tables you want to delete and then drop it after the stabilisation period is over</p>
  
  <p>Here is my plan.</p>
  
  <ol>
  <li>Rename all the tables which I want to delete, with a suffix say "_TBR" (To be Removed).</li>
  <li>Add a suffix with yyyymmdd format, eg. if the name of the table is EmployeeDetails, it will be EmployeeDetails_TBR_20150614.</li>
  </ol>
  
  <p>Thus, I will create a stored procedure, that will select all the tables which has a suffix of <em>TBR</em> and place it into a temp table, along with date time
  eg </p>
  
  <pre><code>select 
      name AS 'TableName',
      convert (datetime, substring (name, len(name)-7,8)) as 'DeletedOn'
  from 
      sys.tables 
  where 
      name like '%_tbr_%' and 
      type ='u'
  </code></pre>
  
  <p>now</p>
  
  <pre><code>SELECT TableName FROM #TempTable WHERE DeletedOn &lt;=GETDATE()
  </code></pre>
  
  <p>This will select all the tables that are beyond the specified date.
  Now, declare a cursor, and then loop in and delete it.</p>
  
  <p>I will schedule a job to run this stored procedure every week, and it will take care of.</p>
  
  <p>Is there any other smarter and optimized way of doing it?</p>