StrataFrame Forum

How to restore SQL transactions

http://forum.strataframe.net/Topic16833.aspx

By Ger Cannoll - 6/4/2008

This is not really a Strataframe issue but would welcome any comments , as most users around here seem to use SqlSErver. I have been playing around with SQLSERVER over last few months and am concerned , that when I have live data, I will not be able to restore transations.

Say for instance, I do the following in Management studio:

Delete From Mytable where 1=1, amd the table was 600,000 transactions...takes a few seconds to remove records but would take a long time to re key !!

In VFP. I'd just do a Recall all and problem sorted.

I know there is a Log Table which holds transactions, but there does not seem to be any way from within Sql Server to access this table..... seems stange to me but there you go.



What do you guys use ,to recover from this situation.... I know there are tools out there but an indication of popular/good ones would be useful

Regards,

Gerard
By Trent L. Taylor - 6/4/2008

What do you guys use ,to recover from this situation.... I know there are tools out there but an indication of popular/good ones would be useful

The log file is a complicated component itself, and deletions are handled different than VFP.  But there are also a lot more tools (even within SQL Server itself) for backup etc.  First of all, we have nightly backups of our SQL Server database (as well as in the field) in the instance that this happens.  You can also create file groups within SQL Server.  This way you can restore a file group instead of the entire database.

There are tools out there to restore from a log file, but honestly, it isn't worth it.  We were long time VFP users, and used RECALL from time to time as well...but honestly, we haven't missed this one bit and in fact have had FAR fewer issues in the field in regards to getting data restored and backup up from a services perspective.

Just FYI, we automate our backups so that we can set it and forget about it.  This way if we have a problem, like deleting the entire table, then we just go to last nights backup (which is on a server folder) and restore that file.

There are a lot of other ways to go about it as well, but this would be the best route to go as a whole.

You mentioned transactions which is a whole different topic, but if you do not start a transaction before you do this then you cannot roll it back.  But if you have an active transaction, then you can roll it back and everything will show back up.