title: Sql Query to determine when log shipping last took place
body: <p>I need a SQL query to determine when log shipping last occured for a given database. Would this be correct?</p>
  
  <pre><code>SELECT  Max(restore_date)
  FROM    msdb.dbo.restorehistory 
  WHERE   destination_database_name = 'XXXXXXXXXX' AND
          restore_type = 'L'
  </code></pre>