

because a transaction altering multiple tables was lost) as far as your business logic is concerned

Figure out what data was lost or is transactionally inconsistent (e.g.because an active transaction altering the database structure was lost). Run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option to fix up corruptions in the data files – both those that may have caused the issue, and those caused by rebuilding the transaction log (e.g.Use the undocumented and unsupported DBCC REBUILD_LOG command to build a new transaction log.Hack the system tables to get the database into EMERGENCY mode.In these situations, prior to SQL Server 2005, there was no documented or supported way to fix a database while in EMERGENCY mode – the only guidance could be found on the Internet or from calling Product Support and paying for help. People get themselves into situations where they have no backups (or damaged backups) and the data or log files are damaged such that the only way to access the database is with EMERGENCY mode. Using EMERGENCY mode to access a RECOVERY PENDING or SUSPECT database where I introduced EMERGENCY mode and walked through an example script showing its use.Corruption: Last resorts that people try first… where I discussed the two worst things you can do (in my opinion) to a database – rebuilding the transaction log and running REPAIR_ALLOW_DATA_LOSS.We can also help you with disaster recovery.) (Check out my online training courses: SQL Server: Detecting and Correcting Database Corruption and SQL Server: Advanced Corruption Recovery Techniques. (New for 2020: we’ve published a range of SQL Server interview candidate screening assessments with our partner Kandio, so you can avoid hiring an ‘expert’ who ends up causing problems.
