title: How to fix a restoring database without the backup file in SQL Server?
body: <p>One of my colleagues was restoring a backup file on a database and then realized that it's not the right one, so he cancelled the restoring. Now the database is stuck in restoring state and there's nothing to do with it.
  How can we repair the database?</p>
  
  <p>P.S 1: The last backup file was for several hours ago, so we don't want to restore it.</p>
  
  <p>P.S 2: We have the .mdf and .ldf files; however, when we want to detach the database, in order to attach those files, we get the following error:</p>
  
  <blockquote>
    <p>Cannot detach a suspect or recovery pending database. It must be repaired or dropped.</p>
  </blockquote>