-
Written By
Yousuf Hasan -
Published on
February 27th, 2019 -
Updated on
March 1, 2021 -
Read Time
4 minutes
In this article I am going to tell you how you can restore a single table from SQL Backup. I know many of you must be familiar with the technique of restoring the whole data from the SQL Backup. But restoring a particular table from backups is a difficult task.
Many users have a doubt that if we can restore the whole data from SQL Backup then what is the need for restoring a single table separately. So I would like to clear their doubts that if you restore whole data then it will occupy a lot of space and it will be difficult for you to find the needed file in the bulk files.
Therefore there are some manual ways through which you can restore the table from SQL Backup according to your need.
Use STOPAT Command to restore a table from the SQL 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”
“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”
“USE Ariadatabase GO SELECT * INTO Employee.Details FROM Ariadatabase_Restored.Employee.Details”
“USE Ariadatabase GO SET IDENTITY_INSERT Employee.Details ON MERGE Employee.Detailsdest USING (SELECT * FROM Ariadatabase_Restored. Employee.Detailssrc) 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”
“DBCC CHECKTABLE (“Employee.Details”)”
I hope by now you must have restored your table from SQL backups. But I know the fact that many of the non-technical users find it difficult as moving a mountain.
Well, this is true that the manual techniques will take a lot of time without any kind of assurance of recovery. So what should you do now?
I must suggest that you must go for SQL Backup Recovery Software if you don’t want to do this much complex stuff. The reason for that is not only it will save your time but also gives the 100% guarantee for restoring the tables from the SQL Backup files.
You must only go for this tool if you fulfill the following Criteria:-
The ball is in your court and you have to decide whether to follow the complex methods or go for the easy and assured tool that will tell how to Backup And Restore SQL Database. I have already mentioned both the ways, so ultimately it is your call to make. I hope the information I have provided is enough for you to restore a table from the SQL Server.
Related Post