{"id":3426,"date":"2015-12-16T09:55:40","date_gmt":"2015-12-16T14:55:40","guid":{"rendered":"https:\/\/academy.sqlbak.com\/?p=3426"},"modified":"2023-10-17T04:56:53","modified_gmt":"2023-10-17T08:56:53","slug":"database-adventureworks-cannot-be-opened-it-is-in-the-middle-of-a-restore-msg-927","status":"publish","type":"post","link":"https:\/\/academy.sqlbak.com\/database-adventureworks-cannot-be-opened-it-is-in-the-middle-of-a-restore-msg-927\/","title":{"rendered":"Database ‘Adventureworks’ cannot be opened. It is in the middle of a restore (Msg 927)"},"content":{"rendered":"
To understand how to avoid “Database ‘Adventureworks’ cannot be opened. It is in the middle of a restore<\/em>” error let’s consider the following example:<\/p>\n Assume,\u00a0in the database some crucial data were deleted, and the restore operation was started<\/p>\n <\/p>\n Note, that even if \u00a0the full backup was restored the database still is in the NORECOVERY<\/span> state and there is no way to use it. But if you try to run this database the SQL Server will send this error message:<\/p>\n Here are some ways how to avoid this error.<\/p>\n To understand how to avoid “Database ‘Adventureworks’ cannot be opened. It is in the middle of a restore” error let’s consider the following example: Assume,\u00a0in the database some crucial data were deleted, and the restore operation was started RESTORE DATABASE Adventureworks\u00a0FROM DISK = ‘Adventureworks_full.bak’ WITH NORECOVERY, REPLACE\u00a0<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[159],"tags":[],"yoast_head":"\nRESTORE DATABASE<\/span> Adventureworks\u00a0FROM DISK<\/span> = 'Adventureworks_full.bak'<\/span> WITH NORECOVERY<\/span>, REPLACE\u00a0<\/span><\/pre>\n
Msg 927, Level 14, State 2, Line 3<\/span>\r\nDatabase 'Adventureworks' cannot be opened. It is in the middle of a restore.<\/span><\/pre>\n
\n
RESTORE DATABASE<\/span> Adventureworks\u00a0FROM DISK<\/span> = 'Adventureworks_full.bak'<\/span> WITH RECOVERY<\/span><\/pre>\n
\n