Sql server log file stores the every log in information.is it possible to revert the query operation which we doing through query editor or by application based on the session we are logged in?
Thanks in Advance
|
Sql server log file stores the every log in information.is it possible to revert the query operation which we doing through query editor or by application based on the session we are logged in? Thanks in Advance |
|||
|
If you are using transactions, you can rollback your transaction. If you are looking to restore your database, the answer is no. Providing that you are in Full Recovery model and have log backups, you can restore to a point in time, such as LSN, Time or Marked Transaction, but you cannot roll forward your restore on a session by session basis as this could leave the database in an inconsistent state. Imagine your session deleted some rows from a table...What if another session had created those rows and you did not roll forward the other session? It just wouldnt work. You could consider using Database Snapshots moving forward. This will give you a point-in-time copy of the database which you can use to "undo" data modifications. For example if your session deleted some rows, you could do an INSERT into your database, SELECT from snapshot |
|||
|
|
rollbackyour transaction? – a_horse_with_no_name Oct 18 '12 at 6:24