The Hackersquad

Data Recovery

In this article we will take a look at the steps which you can follow to quickly identify the user who deleted the user database in SQL Server.

There are two different methods by which one can easily find who deleted the database in SQL Server. The first method is using builtin Schema Changes History Report. The second method is to load the SQL Server Default Trace into a table to see who deleted the database.

Recover Deleted Records in SQL Server

There are times when users face disastrous database situations in their SQL Server databases. The scenarios could take place during the management and maintenance of their database records. Sometimes the database records are deleted by mistake, due to which database administrators face many issues. Hence, to get back to the normal workflow, the records need to be recovered back to the SQL Server database.

Here are some suggested methods that you can use to recover deleted records in SQL Server database.

Methods to Recover Deleted Records in SQL Server

In this section, we will discuss manual as well as an automated method to recover deleted data from SQL Server.

Recover Deleted Data in SQL Server Using LSN:

LSNs (Log Sequence Numbers) are unique identifiers that are assigned to every record in the SQL Server transaction logs. Hence, deleted rows of SQL tables are recoverable if the time of their deletion is known.

To start the recovery process there are several prerequisites to be fulfilled to recover deleted data from the SQL Server Table using LSN (Log Sequence Number). For smooth recovery of deleted rows from SQL Server database table, it should have Full Recovery Model or Logged Recovery Model at the time the data deletion took place.

Use the below-mentioned steps for recovery of deleted data from SQL Server 2016, 2015, 2014, 2012, 2008 and 2005.

Step 1: Use the below-mentioned query to check the number of rows present in the table from which the data got deleted