Home » Blog » SQL Server » How to Restore Only One Table from SQL Server Backup File?
SQL Server

How to Restore Only One Table from SQL Server Backup File?

  author
Published By Mohit Jha
Nimisha Ramesh
Approved By Nimisha Ramesh
Published On December 4th, 2023
Reading Time 9 Minutes Reading

Restore Only One Table from SQL Server Backup

Do you want to restore only one table from SQL Server backup file? Tired of looking for a solution? If yes, then your search is ended here. In this blog, we will help you out to restore single table from SQL Server backup file. Here, we provide a step-by-step solution so that anyone can SQL Server Recovery for one table backup easily and without disruption.

Microsoft SQL Server has no inbuilt function to restore a specific table from backup file. Instead of getting a solution to restore a single table from SQL backup file, users restore only the entire backup in SQL Server. Microsoft provides a free SQL Server Management Studio software application and T-SQL commands to create database backup in SQL & restore it. Before proceeding to the solution, let’s take a look at the queries of some users to understand their exact requirements.

User Queries- How to Recover Single Table from Backup?

“Does anyone know how to restore only one table from SQL Server backup file? I have a full backup of Microsoft SQL database full backup in the .bak file extension. Now my manager told me to recover a single table from backup file as he needs to check some information. I don’t know if it is possible or not, but need to restore table urgently. Please help me how can I do that? Thanks!”

Alexis Martin, Australia

“With SQL Server 2008, we do a weekly or sometimes monthly full backup because we do not lose the details of our employees and customers. From a week ago, I am looking for a solution to recover a single table from MS SQL Server backup file, but I can not find any clear answer. I want to know if it is possible to restore only one table from backup without restoring the full database backup. Thanks in advance.”

Beckett Smith, USA

How to Restore Only One Table from SQL Server Backup?

There is no direct or instant method to recover specific table from SQL database backup file. First, you need to restore a full database backup to a new database and then copy the required table to live database.

Step 1. Restore Complete Backup

First, you must restore the full backup of the SQL database and the transaction log to the point where the required table was deleted. It is recommended that you stop the transaction process before the time the table was dropped.

You can use STOPAT command to restore a table from SQL database backup.

RESTORE DATABASE Ariadatabase FROM DISK = 'C:\Ariadatabase.BAK'
WITH NORECOVERY
GO
RESTORE LOG Ariadatabase FROM DISK = 'C:\Ariadatabase.TRN'
WITH RECOVERY,
STOPAT = 'May 19, 2016 11:40:00 AM'
GO

Step 2. Copy Required Table to the SQL Database

Now, to restore only one table from SQL Server backup file, you need to copy the data from the backup to the destination database. In the below section, we mentioned the different techniques, you can use one of the following:

  • The table still exists, but some rows have been deleted

Use the INSERT statement combined with a SELECT statement to insert only missing rows in the table.

USE Ariadatabase
GO
SET IDENTITY_INSERT Employee.Details ON
INSERT INTO Employee.Details
(Name, ID, Age)
SELECT * FROM Ariadatabase_Restored.Employee.Details
SET IDENTITY_INSERT Employee.Details OFF

  • The Table was dropped completely

Use the SELECT INTO statement to copy the rows and the table structure back to the original database.

USE Ariadatabase
GO
SELECT * INTO Employee.Details
FROM Ariadatabase_Restored.Employee.Details

  • Few Rows were damaged due to update or some other unwanted event

In this process to restore one table from SQL backup file, let’s move ahead. Users can also use the MERGE statement to update damaged data, insert missing data and delete rows that should not be present in the table.

USE Ariadatabase
GO
SET IDENTITY_INSERT Employee.Details ON
MERGE Employee.Details dest
USING (SELECT * FROM Ariadatabase_Restored. Employee.Details src) AS src
ON dest.Name = src.Name
WHEN MATCHED THEN UPDATE
SET dest.ID = src.ID, dest.Age = src.Age
WHEN NOT MATCHED THEN INSERT
(Name, ID, Age) VALUES
(src.Name, src.ID, src.Age);
SET IDENTITY_INSERT Employee.Details OFF

Step 3. Recreate indexes, triggers or constraints if required

Step 4. If any referential integrity issues occur, resolve them manually

Step 5. Run the DBCC CHECKTABLE command on the table to verify the data integrity

DBCC CHECKTABLE (“Employee.Details”)

Suggested Solution to Restore Only One Table From SQL Server Backup

The mentioned method is the perfect solution to recover a specific table from the SQL database backup file. But, above all these things, this process is very time taking and also confusing for non-technical users. If you want the easiest and fastest way to restore only one table from backup SQL, must use SQL Server Backup Recovery software. This is the best application for restoring a single table from the .bak file. It is compatible with all versions of Microsoft SQL Server such as SQL Server 2017, 2016, 2014, 2012, 2008, 2008 R2, etc. The software supports to repair corrupt SQL Server Backup file and restore SQL database from BAK file. You can free download the SQL BAK file Recovery software from the below download link.

Download Now Purchase Now

Restore Table from Backup SQL Step-by-Step

We know which is the most trusted solution to restore damaged databases using backup file of SQL Server. It’s time we quickly jump to the solution of this software that comprises just five simple steps.

Step-1. Launch the Automated Utility in your system to begin.

Step-2. Click the Open button to simply Add SQL BAK data files.

click open button

Step-3. Add Multiple backup files or an entire folder.

add BAK files

Step-4. Enter the Destination Location to Save your restored files.

enter destination location

Step-5. Finally, Click on the Export or Save button to finish the task.

click export to restore table from backup SQL

Note: Do not forget to Select the “Run as Administrator” option while launching the too. This will help users to avoid all kinds of hassles regarding permissions for the task.

Tool Features to Restore Only One Table from Backup SQL Server

The automated software comes with plenty of advanced features that can easily help users learn how to restore one table from SQL backup without any hassles. Let’s have a look at the features of this tool that help users eliminate all risk factors & execute the entire operation with ease.

Restore All Objects of SQL Server

This advanced utility can help users restore one table from SQL backup with all other objects like stored procedures, triggers, classes, indexes, views, rules, etc. Moreover, it can even recover the deleted or corrupted data files as well.

Two Scan Modes for Corrupted Files

For minor & major corruption issues in the utility, users can get two scan modes in this utility. The Quick Scan mode is for non-corrupted or minorly corrupted files. Whereas, the majorly corrupted files can be scanned with Advanced Scan mode.

Multiple Export Options

The software can restore single table from SQL backup & export the files after recovery in three ways. There are three export modes available. These modes are live SQL Server, SQL Scripts, & CSV files. Users can select any of these three based on their requirements.

Auto-Detect SQL Server Version

This software supports SQL Server versions, 2000, 2005, 2008/20078 R2, 2012,2014, 2016, 2017, 2019, & 2022. Also, using the BAK files, it automatically detects the SQL Server version & also provides a manual option for this to users.

Apart from these features, learning how to restore one table from SQL backup is quite easy because of the other amazing features of this tool. Now, let’s quickly move ahead towards the conclusion. Although now, we all are aware of the right tool & technique, still users must make wise decisions based on their specific needs.

The Concluding Words

In this blog, we mentioned the solution to restore only one table from SQL Server backup file step by step. With the help of this method, you can restore single table from SQL Server backup file. If the backup is corrupted, we recommended the best software which helps to repair corrupt BAK file and restore database from backup in SQL Server with complete accuracy.

Frequently Asked Question

Q-1. What is the primary command to restore database in SQL Server?

Ans. The primary command for users to simply restore table from backup SQL is:

RESTORE DATABASE [DB_Name]
FROM DISK = 'C:\Path\To\BackupFile.bak'
WITH REPLACE;

Q-2. Which method is ideal for SQL Server restore table from backup file? Manual or Automated?

Ans. Both the solutions work. However, there will be different levels of features, results, & experience in both of these features. It’s like walking 10 miles on foot as well as riding a bicycle for the same 10 miles. The automated solution gives users leverage to get maximum output by putting in just a small amount of effort.

Q-3. Will this tool work in case I forget my SQL Server password? 

Ans. No, this solution only works for the recovery of backup files. Users can try SQL Server password recovery tool for recovering the passwords of SQL database. 

Q-4. Is this software free to use & restore a single table from SQL backup?

Ans. No, this advanced software is not free to use but it comes with a demo version. This way, users can try this solution & purchase the full version only after liking it.

Q-5. How do I restore a full and log backup in SQL Server?

Ans. After learning how to restore table from backup SQL file, users need to put different commands for different events. Therefore, there are two commands for full & log backup in SQL Server. Let’s have a look at these commands below to restore only one table from backup SQL Server with ease:

  • Full Backup: 
RESTORE DATABASE [YourDatabase]
FROM DISK = 'C:\Path\To\FullBackupFile.bak'
WITH NORECOVERY;
  • Log Backup:
RESTORE LOG [YourDatabase]
FROM DISK = 'C:\Path\To\LogBackupFile.trn'
WITH NORECOVERY;