SQL Server data can be recovered from a suspect database by first understanding why the database was marked suspect, then either bringing it back online through repair options or extracting the data into a new database when repair is too risky. The database is marked suspect when SQL Server cannot complete recovery at startup—typically because the transaction log is missing or corrupt, the data file is damaged, or a required file is unavailable. The critical point is that "suspect" is a state, not a verdict: the data files usually still exist, and recovery is a matter of choosing the least destructive path that gets the rows out safely.

This article answers the practical question for the common case: a database on SQL Server (the Microsoft product; MySQL and other engines do not have a "suspect" state) that has flipped to SUSPECT after a restart, crash, or storage failure, and an administrator who needs the data back. The exact steps differ depending on whether you have a good backup, whether the log survived, and how much corruption exists—so the distinctions matter more than any single script.

What "suspect mode" actually means

When SQL Server starts a database, it runs recovery: it redoes committed transactions from the log and rolls back uncommitted ones. If that process fails—for example, the log file is gone, a page is unreadable, or a file path changed—SQL Server cannot guarantee a consistent database, so it marks it SUSPECT and refuses normal access. The state is visible in sys.databases (state_desc = 'SUSPECT') and in SSMS, where the database name shows "(Suspect)" and most operations are blocked.

Two implications follow. First, suspect mode is protective: SQL Server is preventing you from using a database whose consistency it cannot verify. Second, the underlying files are usually still on disk. That is why recovery is possible at all—you are not reconstructing data from nothing, you are finding a way to make the files consistent again or to read them through another route.

The most common causes:

Missing or corrupted transaction log. Someone deleted or moved the .ldf, or the disk holding it failed. This is the single most frequent trigger. Corrupt data file or page. Bad sectors, a failed array, or an unclean shutdown that left pages inconsistent. File path or permission problems. The service account lost access, or files were restored to a different path than the one recorded in the system catalog. Abrupt shutdown or power loss during a write, especially with a log file on unreliable storage.

Knowing the cause shapes the fix: a missing log calls for one set of options, a corrupt page for another.

First: preserve the evidence

Before running any repair, make a file-level copy of the database's .mdf and .ldf (and any secondary .ndf files) to separate storage. Repairs modify files in place, and some options discard data. A copy costs minutes and preserves your fallback if a repair makes things worse. Also capture the exact error from the SQL Server error log—it usually names the file or page that failed and tells you which scenario you are in.

Rank your options from least to most destructive

Recovery approaches differ in how much data they risk. Work down this list rather than jumping to the most aggressive tool.

1: Fix the cause and let SQL Server recover normally

If the problem is environmental—a moved file, a permissions change, a detached drive—correcting it and restarting SQL Server may let recovery complete on its own, returning the database to ONLINE with no data loss. Check the error log for messages about file paths or access denied. This is always worth trying first because it is non-destructive.

2: Restore from backup

If you have a recent backup, restoring it is the cleanest recovery. Restore the last full backup and apply differential and log backups as available. This is the only approach that reliably returns a fully consistent database, and it should be the default whenever backups exist. The catch, of course, is that it loses everything after the last log backup—which is exactly why the remaining options exist.

3: Emergency mode for inspection

If you want to look at the data before committing to a repair, you can force the database online in a restricted state:

Emergency mode marks the database READ_ONLY and permits sysadmin access. It does not repair anything, but it lets you run consistency checks and, if the database comes up, query and export data. If CHECKDB reports errors, you now have a map of the damage. Note that emergency mode may itself fail if the log is unusable—in that case you cannot avoid the log-related options below.

4: Repair with DBCC CHECKDB—and understand what it costs

DBCC CHECKDB with a repair option can fix certain problems:

The word that matters is ALLOW_DATA_LOSS. The repair may delete corrupt pages or rows to restore consistency. Microsoft's own guidance treats this as a last resort for databases without backups, precisely because it can silently remove data. Never run it on a database you have not copied, and never assume it recovers everything. If the log is missing, CHECKDB may still refuse to run until the log issue is addressed, which leads to the next option.

5: Rebuild a missing or corrupt log

If the transaction log is gone and you accept the risk of an unclean shutdown, you can force SQL Server to rebuild the log:

In some versions and scenarios, attaching the data file without its log, or using ALTER DATABASE ... REBUILD LOG, forces creation of a new log. The database then comes online, but any transactions that were only in the lost log are gone, and consistency is not guaranteed—so run CHECKDB immediately afterward and expect that a repair may be needed.

6: Extract data into a new database

When repair is too risky or fails, the safest path is to salvage rows rather than fix the original. Options include:

INSERT INTO ... SELECT across databases. If you can bring the suspect database online in emergency mode, create a new database and copy tables over. This preserves the original files untouched. Import/Export Wizard or bcp. Export individual tables to flat files or a new database. Useful when only some tables are readable. Third-party recovery tools. Commercial SQL recovery utilities read damaged .mdf files directly and export schema and data to a new database. They are worth considering when the database will not come online at all and no backup exists. Evaluate them on a copy, never the original.

The extraction approach has a real advantage: it never modifies the source, so a failed attempt costs nothing.

A decision path in practice

Situation Best first move Fallback
Recent backup exists Restore backup Point-in-time restore with log backups
File path/permission issue Fix path, restart service Emergency mode
Log missing, backups exist Restore Rebuild log only if post-backup data is essential
Log missing, no backup Emergency mode, export data Rebuild log + CHECKDB, then export
Corrupt pages, no backup Emergency mode, CHECKDB to assess REPAIR_ALLOW_DATA_LOSS, then export
Database won't come online at all Third-party reader on a copy Restore from any available backup

Two habits make this path safer. First, always work on copies. Second, export data to a new database rather than repairing in place whenever the data matters, because repair's data loss is not always obvious until later.

Why not just run REPAIR_ALLOW_DATA_LOSS immediately?

Because it is irreversible and its damage can be subtle. A repair might drop an entire corrupt page—hundreds of rows—while leaving the database "consistent" and online. If you later discover the loss, the original damaged file has already been altered. The professional sequence is: preserve files, attempt non-destructive fixes, bring the database up in emergency mode to assess and export, and only then consider repair on a copy of the files. The goal is recovering data, not merely changing the database's state from SUSPECT to ONLINE.

Common misconceptions

"Suspect means the data is gone." Usually false. The files are typically intact; the server simply cannot guarantee consistency. Many suspect databases are recovered with zero or minimal loss.

"Detaching and reattaching fixes it." Sometimes an attach with FOR ATTACH_REBUILD_LOG helps when the log is missing, but detaching a suspect database can fail or worsen the situation. Treat it as a deliberate option, not a reflex.

"MySQL/Oracle have the same suspect mode." They do not. This state and these commands are specific to Microsoft SQL Server. Other engines have their own corruption and recovery mechanisms with different terminology.

"A repair is a recovery." A repair restores consistency; recovery restores data. They overlap but are not the same, and the distinction is exactly why export-to-new-database is often the better ending.

Preventing the next suspect database

The most reliable recovery strategy is never needing one. Keep full backups with tested restores, store log files on reliable storage separate from data files, avoid deleting or moving database files while the service is running, and monitor the error log for I/O warnings before they become failures. A database that goes suspect once is telling you something about its storage or maintenance—listen to it.

The bottom line

SQL data can be recovered from suspect mode because suspect is a protective state, not deletion. Start by preserving the files and reading the error log, then choose the least destructive route: fix environmental causes, restore from backup if possible, use emergency mode to inspect and export, and reserve REPAIR_ALLOW_DATA_LOSS and log rebuilding for cases where no backup exists and you accept the risk. When in doubt, extract the data into a new database and leave the original untouched—that is the approach most likely to return your rows intact.