I had the blood-drawn-from-face moments when a database stated is was ‘pending recovery’. Ultimately the transaction log file was broken. Actually I didn’t care about that because I knew it was pretty much all read-only data. So how to recover it? I tried various recovery techniques but the server was adamant, ‘restore from backup’. Well, I couldn’t do that either. So finally I found this little nugget of DDL, create a new database using the existing data files but with a new transaction log;
CREATE DATABASE [<new dbname>]
ON PRIMARY
( NAME = N'<filename>’, FILENAME = N'<path to>.mdf’ ),
( NAME = N'<filename2>’, FILENAME = N'<path to 2nd>.mdf’ )
FOR ATTACH_REBUILD_LOG