Skip to content
Advertisement

How can I view an earlier version of a table on a T-SQL server?

I’ve just done something very silly. In both the productive and development environments on our SSMS server, I’ve changed the wrong column in one table. I know exactly what rows have been changed, but not what their original values were. I did not use a transaction. Is there any way to view the history of the table or see a backup of it? For example, if I could find what it looked like yesterday, my day would be saved.

Advertisement

Answer

The first answer is to restore the data from a backup (into a separate database or a separate server). If you have transaction log backups, you can also use a point-in-time restore.

You can also try https://www.apexsql.com/sql-tools-log.aspx, to see if you can find the changes in the transaction log. But it won’t work if you are using the SIMPLE recovery model.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement