title: How to find last execution time of a stored procedure during last one year?
body: <p>I have a stored procedure which is not run on a very frequent basis. So I want to find the last execution date of that stored procedure. </p>
  
  <p>I used this query:</p>
  
  <pre><code>select distinct 
      s.last_execution_time
  from 
      sys.dm_exec_query_stats s
  cross apply 
      sys.dm_exec_query_plan (s.plan_handle) p
  where 
      object_name(p.objectid, db_id('My_Db_Name')) = 'MY_Sp_Name' `
  </code></pre>
  
  <p>It returns no output. So is there any alternate way to check weather the stored procedure ran during last month or not?</p>
  
  <p>Thanks in advance</p>