Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
In my app,I want to implement the undo/redo for the database like MS office does.
I wonder if there is a mechanism to do this for sql server 2008.
Thank~ :)
even if user shut down the app,next time he still can redo/undo what he did before.
Posted
Updated 24-Jul-11 19:53pm
v3

1 solution

Not that I know of. For undo, the only efficient way you can implement it is by restoring your backup. You can, however, implement a history mechanism on your code record what is happening to your records. The drawback, on the other hand, is an additional space and processing on your database. It might be applicable for small applications, but not for large systems.

[Update]

This might be a helpful resource when you want to learn about SQL Triggers.
http://www.sqlteam.com/article/an-introduction-to-triggers-part-i[^]
 
Share this answer
 
v2
Comments
eric881027 25-Jul-11 1:12am    
if can I record all the actions in a table or a log?
walterhevedeich 25-Jul-11 1:19am    
Exactly. I did a small project before where I used triggers to record the activities made to a record. You might want to explore about that one. Basically, what I did was to use it to insert a log into a table whenever an insert/update/delete is made to the record.
eric881027 25-Jul-11 1:32am    
Yeah,this is what I am thinking about.Do you have any experience about that,what need be paid attention to?
walterhevedeich 25-Jul-11 1:40am    
Read more about SQL Triggers. I have updated my answer and included a URL where it might help for your learning.
eric881027 25-Jul-11 1:51am    
But I have to use the SQL CE,it does not support trigger.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900