Help, please. Is there any other way to display deleted rows in SQL Server except for using trigger and deleted table or writing SELECT before DELETE with the same WHERE clause?
Recover Deleted Data in SQL Server Using LSN: LSNs (Log Sequence Numbers) are special identifiers that are allocated to each record in the SQL Server exchange logs. Subsequently, erased columns of SQL tables are recoverable if the time of their deletion is known.
Now, to get the complete detail of that user, you can pass [Transaction SID] within suser_sname() function. After executing the above command, you will be able to find out who deleted data from table in SQL Server.
You can use the output clause of the delete statement.
delete from yourtable
output deleted.*
where ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With