Many of you may have encountered the following problems:
If the update or delete statement does not include the WHERE clause or the WHERE clause is not accurate enough, the execution may cause serious consequences. In this case, data recovery can only be performed using the backup of transaction logs, therefore, if your SQL statement does not have a full-database backup or cannot back up logs (the truncate log on checkpoint option is 1), data cannot be restored, or you can only recover the data from the last backup.
The following describes how to restore data:
1. If a full-Database Backup (or multiple differential or incremental backups exist) exists before the misoperation ), the first thing to do is to perform a log backup (if trunc is set to prevent the log file from becoming larger. log On chkpt. if option is set to 1, you will die)
Backup log dbname to disk = 'filename'
2. Recover a full-database backup. Use with norecovery. If there are other differences or incremental backups, recover them one by one.
Restore database dbname from disk = 'filename' with norecovery
3. Restore the last log backup, that is, the log backup you just created. Specify the recovery time point to the time before the misoperation.
Restore log dbname from disk = 'filename'
With stopat = 'date _ time'
These operations can be completed in the SQL Server Enterprise Manager, which is not difficult...
Of course, if the misoperation involves operations that do not remember logs, such as truncate table and select into, the above methods cannot be used to recover data...