Friday, March 9, 2012

Is there any way to 'undo' an update query?

I guess I am in big trouble now.

I have updated a table by querying in SQL Query Analyzer and one of table columns was all set to wrong data (of course it was because of my mistake in query sentence). I am wondering if there is any way to recover this table?

Unfortunately my database was not backuped after this table was created. I am wondering what the log file is for. Maybe can there any way to retrieve a table's old status by using the log table?
Any help?

without a database backup there's no way to restore data from a previous point in time. A log file can be used to store incremental changes from the last database/log backup.

in the future you may want to start your TSQL statement with a BEGIN TRAN, and allow yourself the ability to roll it back should you find yourself in a similar situation.

|||OK. I guess I gotta do all annoying import job again to make the table.
Anyway, thanks a lot, Greg. I appreciate your advice.

No comments:

Post a Comment