title: SQL RESTORE WITH RECOVERY; Hangs at 100%
body: <p>I have done a lot of research about this.</p>
  
  <p>I am attempting to recover a database with SQL Server 2014 and it keeps hanging at 100%.</p>
  
  <p>A lot of people suggest that the solution is to just make sure that you restore with the RECOVERY option.</p>
  
  <p>I have tried that and it still hangs at 100%. I have tried via the SSMS Restore dialog and I have tried running the following SQL Statement:</p>
  
  <pre><code>USE [master]
  RESTORE DATABASE [MyDB]
  FROM  DISK = N'C:\MyDB_backup_2015_05_05_010004_1506557.bak'
  WITH  
      FILE = 1,  
      MOVE N'MyDB_Data' TO N'F:\MSSQL\DATA\MyDB.mdf',  
      MOVE N'MyDB_Log' TO N'F:\MSSQL\DATA\MyDB_1.ldf',  
      NOUNLOAD,  
      REPLACE,  
      RECOVERY,
      STATS = 2
  GO
  </code></pre>
  
  <p>When I check the status of the command via:</p>
  
  <pre><code>SELECT r.status, r.command, r.wait_type, r.percent_complete
  FROM sys.dm_exec_requests r
  WHERE r.command like '%restore%' or r.command like '%backup%'
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>status: suspended
  command: RESTORE DATABASE
  wait_type: BACKUPTHREAD
  percent_complete: 100
  </code></pre>
  
  <p>Which from my reading implies that the RESTORE is waiting for a BACKUP to complete, but there is no BACKUP command returned from my query to sys.dm_exec_requests</p>
  
  <p><em>EDIT</em>: After trying it again and running the above query to watch the progress of the RESTORE from the beginning, I can see that the 'percent_complete' value is increasing steadily, despite the fact that the 'status' remains as 'suspended' and the 'wait_type' remains as 'BACKUPTHREAD'.</p>
  
  <p>So despite it being 'suspended' it is actually still performing the RESTORE.</p>
  
  <p>So I'm at a loss...</p>
  
  <p>Anyone got any ideas what's going on here or any tips on how to diagnose the issue?</p>
  
  <p>Cheers!</p>