SQL error...

stoymigo

Senior Member
Joined
Dec 11, 2008
Messages
975
Reaction score
26
I've had to restore a database a couple of times after testing some stuff, problem now is I get an error which prevents me to access the database:

Msg 927, Level 14, State 2, Line 1
Database 'dbName' cannot be opened. It is in the middle of a restore.


What also happened today was the server was restarted, which contains many database like this one, I don't know if that could contribute to this.

I've tried running "RESTORE DATABASE dbName WITH NO/RECOVERY" but i still get teh error that it's restoring :confused:

I use mssql 2005 and 2008
 
I've got a .BAK file of the database, should I drop it, create a new one and restore it from the backup file as an alternative or too risky?
 
If the BAK file is ok to use and you can survive with overwriting the existing database you can:

Go into services.msc and restart the SQL Server instance related to this database
That should make the server useable but leave the database in a state,at which point i'd delete the offending database and restore to a new blank slate from the BAK file
 
Top
Sign up to the MyBroadband newsletter
X