SQL Server doesn't keep a single tidy "restore history" screen. It records restore activity in several places, and which one you check depends on whether you need proof of a full database restore, a page or file restore, or the backup records those restores came from. The fastest answer for most DBAs is a query against msdb.dbo.restorehistory joined to msdb.dbo.backupset. That gives you restore dates, target databases, who ran them, and which backup sets were applied. For anything older than the retention window of msdb, or for restores done via file copy and attach, you'll need the error log, default trace, or a custom audit table.
This guide walks through each source, the exact queries, what each column means, and where the data runs out.
What "restore history" actually means in SQL Server
Before writing queries, separate the concepts. SQL Server tracks:
Restore operations — rows in msdb.dbo.restorehistory, one per restore or recovery action. Restored backup sets — rows in msdb.dbo.restorefilegroup and related tables that map restores to the backup sets used. The backups themselves — msdb.dbo.backupset, backupmediafamily, and backupfile, which persist whether or not a restore ever happened. Non-restore recovery events — attaching a database, recovering a suspect database, or restoring via third-party tools may leave traces elsewhere or nowhere in msdb at all.
That last point trips people up. If a database was restored using WITH MOVE from a .bak file on another server and msdb was rebuilt since, restorehistory won't have it. So the honest answer to "how do I search restoration history" is: query msdb first, then fall back to logs and your own audit trail.
Prerequisites: permissions and connection
You need read access to msdb. Membership in db_datareader on msdb, or the sysadmin/dbcreator fixed roles, is typically sufficient. If you can't see restorehistory rows, it's usually a permissions issue, not an empty table — check with:
Connect to the instance that performed the restore, not necessarily the instance where the database now lives. Restore history lives on the target instance's msdb, so if you restored onto a new server, query that new server.
Step 1: The core query against msdb.dbo.restorehistory
The base table is small and readable. Run this to see the shape of the data:
What the columns tell you:
restore_date — when the restore finished, in server local time. destination_database_name — the database name as it existed at restore time. If it was later renamed, this table still shows the old name. user_name — the login that issued the restore. Useful for accountability but not proof, since it reflects the SQL login, not necessarily the human. restore_type — D for database, F for file, G for filegroup, L for log, I for differential, V for verify-only, P for page. Verify-only and page restores matter for forensics. replace — whether WITH REPLACE was used, which overwrote an existing database. recovery — whether the restore recovered the database or left it in NORECOVERY for further restores. restart and stop_at — whether a restart or STOPAT point-in-time was requested. stop_at is a datetime; stop_at_mark_name records a marked transaction name.
That last group is where restore history becomes genuinely useful for point-in-time questions: you can prove that a database was rolled back to a specific timestamp, not just that "a restore happened."
Step 2: Join to backupset to see which backups were restored
restorehistory alone doesn't list the backup files. That mapping lives in restorefilegroup and restorefile, which reference backupset via backup_set_id. A practical join:
A few cautions. restorefilegroup has one row per filegroup restored, so a single database restore can produce multiple rows; deduplicate with DISTINCT if you only want one line per backup set. The physical_device_name can be a path that no longer exists — restore history preserves where the backup was, not where it is now. And backupset rows are subject to their own cleanup, so an old restore may outlive its backup record or vice versa depending on maintenance.
Step 3: Filter by database, user, date, and restore type
Most real searches are targeted. These filters work on the base table:
Beware of ORDER BY ... DESC with no filter on large instances: restorehistory can hold tens of thousands of rows on busy servers. The table has no index on restore_date by default, so add a TOP and a narrow WHERE clause. Also note the region/time zone subtlety: restore_date is stored in the server's local time, not UTC, so a history that spans daylight-saving transitions can look off by an hour. If you need to reconcile with log times, convert consistently.
Step 4: Reconstruct a single restore sequence
When you need to know the exact order of a restore chain (full, then differential, then log backups applied with NORECOVERY), order by restore_history_id, not restore_date:
restore_history_id is an identity column and increments monotonically, so it reflects true operation order even when two restores finish within the same second. The recovery flag distinguishes intermediate steps (0, database still in NORECOVERY) from the final recovery (1). A well-ordered log restore chain should show a series of recovery = 0 rows ending in a single recovery = 1.
Success check: the final row for the chain should have recovery = 1, and the backup_finish_date values should be strictly increasing along the restore_history_id order. If they're not, the chain was built out of order and the restored database may be inconsistent.
Step 5: When msdb has no record — the error log and default trace
msdb is a user database and gets rebuilt, restored, or purged. Backup and restore history retention is governed by sp_delete_backuphistory, often scheduled in a maintenance job, and by the Agent XPs history cleanup. If your restore isn't in restorehistory, check these sources in order:
The SQL Server error log. Restore operations log entries like "Database was restored: Database: X, creation date(time): ..." and "Restore database: Database: X, ..." These entries persist in the current error log and up to six archived logs (.1 through .6 at default settings). Query with:
The parameters are log number (0 = current, 1–6 for archives), log type (1 = error log), and a search string. The search is a substring match, so search for the database name or the word "restore." This is not as structured as restorehistory, but it survives msdb cleanup for as long as logs are retained.
The default trace. On instances where the default trace is enabled (it usually is), trace events record database and file changes, but restore events specifically don't always land there. It's a fallback for "something happened around this time," not a reliable restore log. Query sys.fn_trace_gettable against the current trace files if you go this route; expect sparse results and don't promise completeness.
Step 6: Audit trails for compliance-grade proof
For regulated environments, SQL Server's built-in history is not sufficient on its own. msdb can be tampered with by a sysadmin, cleaned by a job, or lost to a rebuild. If you need defensible restore records, capture them outside SQL Server:
Query Store and Extended Events won't track restores directly, so skip them. A DDL-style audit trigger or Agent job that periodically snapshots restorehistory to a separate audit database or a syslog server closes the gap. A nightly job that copies new rows (by restore_history_id) into a RestoreAudit table gives you tamper-resistant history that survives msdb maintenance. Server-side auditing with AUDIT_BACKUP_RESTORE_EVENT_GROUP via SQL Server Audit captures restore operations at the server level, writes to the audit file, and is independent of msdb. This is the supported mechanism when you need an external, policy-controlled record.
Success check for an audit trail: after a test restore, confirm a row appears both in your audit table and in msdb.dbo.restorehistory, and that the audit file path is writable and retained per your policy. If the audit file fills or the path goes read-only, you'll get no warning until restores go unrecorded.
Step 7: What not to trust in the history
A few limits are worth naming because they cause false conclusions:
user_name isn't attribution. It's the login used for the connection. A shared application login makes every restore look like the same person. destination_database_name is historical. Rename a database after restore and the history keeps the old name. Joining to sys.databases to "confirm" the restore will fail because the name no longer matches. Restores done outside SQL Server leave nothing. Copying an MDF/LDF and attaching, restoring with a third-party tool that bypasses native restore, or restoring a msdb itself produce missing or partial records. If you restored msdb from backup, the restore history you're seeing may be from before the restore of msdb — the act of restoring msdb overwrites its own history at the moment it commits. backupset cleanup is independent. The sp_delete_backuphistory job removes old backup and restore rows based on backup_finish_date, so tightening retention for one can silently remove the other. Verify your cleanup job's retention window before assuming a missing row means "never happened."
That last point deserves a concrete example. If sp_delete_backuphistory @oldest_date = '2026-01-01' runs today, it deletes backupset and restorehistory rows older than that boundary. A restore performed in October 2025 now has no msdb record even though it definitely happened and may have restored a 2024 backup. Your error log, if retained, is the only remaining native evidence.
Step 8: A practical verification workflow
If you're asked to prove a restore happened, work through this order:
1: Query msdb.dbo.restorehistory for the destination database and date window. 2: Join to backupset to identify which backups were applied and from where. 3: Order by restore_history_id and confirm the chain ends with recovery = 1. 4: If absent, check the current and archived error logs with sp_readerrorlog. 5: If still absent, check your audit table or SQL Server Audit output. 6: If none of these has it, state that the evidence is unavailable rather than inferring — a missing record proves nothing either way.
That discipline matters because the failure mode isn't usually a wrong query. It's treating an empty result set as proof that no restore occurred, when in fact the record was cleaned, the msdb was restored, or the operation bypassed native restore entirely.
Stop condition: when to escalate
Stop querying and involve a senior DBA or your platform team when you see a restored database in SUSPECT or RECOVERY_PENDING state, when the restore chain in restorehistory doesn't end in recovery = 1 for a database that is online, or when the msdb history appears to have been altered relative to the error log. Those point to a corrupted or incomplete restore process or a security event, not a reporting problem. Do not run additional restores to "fix" an unclear state until someone with authority over the backups confirms which backup set is authoritative — stacking restores on a suspect database can destroy the evidence you need.
For routine questions — "when was this database last restored and from what backup" — the msdb join query in Step 2 answers it in seconds. Build that as a saved query in your admin toolkit, and pair it with an audit snapshot if your environment requires proof rather than convenience.