1

I have SQL Server version 14.0 (SSMS v17.3) and I wanted to copy and paste (duplicate) database for testing purposes. I did what is explained here (How can I clone an SQL Server database on the same server in SQL Server 2008 Express?) in the first answer (222 votes, version 2014). I managed to create duplicate called MYDB2, but main database MYDB become unavailable. In SSMS I can see:

MYDB (Restoring...)

that never ends (system restart didn't help), and when I open this database I get this error:

"The database MYDB is not accessible. (ObjectExplorer)".

How can I fix first database and what is possible reason of corruption? Thank you in advance!

Jacob Barnes
  • 1,480
  • 1
  • 12
  • 29
user1809566
  • 175
  • 1
  • 4
  • 15
  • It is possible that you missed step 8? That is critical. – Jacob H Nov 17 '17 at 18:20
  • Rather not. I have this file: C:\SQLData\MYDB2.mdf. This one also exists: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\MYDB.mdf – user1809566 Nov 17 '17 at 18:25
  • 2
    Please try running this: `RESTORE DATABASE MYDB WITH RECOVERY`. I've had that happen before and the `WITH RECOVERY` resolved the issue. – Jacob Barnes Nov 17 '17 at 18:25

1 Answers1

3

Please try running this: RESTORE DATABASE MYDB WITH RECOVERY. I've had that happen before and the WITH RECOVERY resolved the issue.

Jacob Barnes
  • 1,480
  • 1
  • 12
  • 29