Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
This might not be possible as a part of DML directly, but can we use SQL logs or some filters or anything in the tables to achieve this?
As mentioned earlier, you cannot rollback a transaction that is committed. However, you may use transaction logs to restore the database to an earlier state. In order to do this, you will have to follow the following steps:
1. Take a backup of the transaction log.
2. Restore the Full Backup.
3. Restore the latest differential backup.
4. Restore all transaction log backups until that time.
5. Restore the last transaction log you just took the backup for in step1 and use the Point-in-time feature in order to specify the exact time you want the database to be restored to.
Note that the point-in-time feature is not available if you are using the Simple Backup recovery model for the database. So hopefully you are using the Full Backup recovery model.
No you cant
It is impossible to rollback after the transaction is commited.
No you can not rollback the tranaction once commited.
once commited can't be rolled back .
You can't rollback any transaction once it is commited. but you need to do backup the database with transaction log. when ever you need to rollback, just restore the last backup with transaction log.
Create a snapshot of database, then execute transaction. To undo the transaction, restore from the snapshot
I think you can't
the only way is to delete the data that you stored
You would have to take a backup before starting the transaction and restore it to revert to the previous state.
Alternatively you can store only the entire tables that you know are going to be affected and use that to compare rows that were added or removed. You would need to ensure foriegn key relationships are accurately maintained before you do your manual rollback.