RE: How to remove recovery pending in SQL server
Put the database in emergency mode and force a repair.
In the database EMERGENCY mode, the database is marked as READ ONLY, logging is disabled, and only system administrators have access. Simply, putting the database in this mode allows you to access an inaccessible database.
After you've accessed the database in EMERGENCY mode, use the DBCC CHECKDB command with the 'REPAIR ALLOW DATA LOSS' option to fix it. To do so, launch SQL Server Management Studio and run the following queries:
ALTER DATABASE [DBName] SET EMERGENCY;
GO
ALTER DATABASE [DBName] set single_user
GO
DBCC CHECKDB ([DBName], REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS;
GO
ALTER DATABASE [DBName] set multi_user
GOPut the database in emergency mode, then detach and reattach the main database.
This technique also implies the setting of db to EMERGENCY mode. After that, take the database offline (detach) before bringing it back online (re-attach). To accomplish so, use SSMS to run the following queries:
ALTER DATABASE [DBName] SET EMERGENCY;
ALTER DATABASE [DBName] set multi_user
EXEC sp_detach_db ‘[DBName]’
EXEC sp_attach_single_file_db @DBName = ‘[DBName]’, @physname = N'[mdf path]’The easiest way to remove recovery pending in SQL server is to use SQL Tools.