How do you restore a deleted record/s directly from the SQL transaction log?

  • How do you restore a deleted record/s directly from the SQL transaction log? I would also like to add that the database is huge. So, restoring from a full SQL backup along with the transaction logs is not an option. Also, I am not interested in any third party tools $$$$, unless it is free.;-)

    I want to use TSQL to accomplish this mission.

  • You can use T-SQL to find in the log where your deleted record is at, but the only way you are going to get it back is from a restore if the delete was already committed.

    You can find a walkthrough of using fn_dblog here on MSSQLTips.com[/url].

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • Hi Shawn, there is no way to restore a record directly from the transaction log? That is too bad, I have a huge database and I do not have the room on my drive to create a duplicate database. I would think that Microsoft SQL team would have some provision (TSQL system stored procedure) that would allow a simple operation like this.

  • ray santalis-466762 (4/4/2014)


    Hi Shawn, there is no way to restore a record directly from the transaction log? That is too bad, I have a huge database and I do not have the room on my drive to create a duplicate database. I would think that Microsoft SQL team would have some provision (TSQL system stored procedure) that would allow a simple operation like this.

    What you think is a simple operation really is not. The transaction log isn't meant to be used the way you are attempting to use it. In addition, the VLF's get flagged as inactive when it does not have any active transactions.

  • Thanks everyone!:-D

    I just wanted to make sure.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply