表级为最终用户备份和还原 [英] Table Level back up and restore for an end user

查看:116
本文介绍了表级为最终用户备份和还原的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在AS / 400上运行的遗留应用程序。我们的应用程序之一允许用户键入一批事务,然后将它们发布到分类帐。在AS / 400应用程序中,我们将在发布之前备份正在发布的数据和分类帐文件。然后,如果批次中的数据出现问题,最终用户可以恢复文件并反转批次的帖子。



我没有看到这个到SQL服务器的简单翻译。这似乎是一个丑陋的要求,但我们的用户在遗留应用程序中被它破坏了。



有关如何在Visual Studio / SQL Server环境中完成此任务的任何建议。

We have a legacy application that runs on an AS/400. One of the applications we have allows users to key a batch of transactions and then post them to a ledger. In the AS/400 application we would backup the data that was being posted and the ledger files prior to the post. Then if something is wrong with the data in the batch, the end user has the ability to restore the files and reverse the post of the batch.

I am not seeing an easy translation of this to SQL server. It seems like an ugly requirement, but our users have been spoiled by it in the legacy application.

Any suggestions about how to accomplish this in a Visual Studio/SQL Server environment.

推荐答案

首先使用转换 - http://www.sqlteam.com/article/introduction-to-transactions [ ^ ]和此处的Microsoft文档http://msdn.microsoft.com/en-us/library/ms174377.aspx [ ^ ]



但是,您似乎暗示用户可以自己做出这个选择(与加载期间出错的情况相比),因此您可能希望使用触发器将事先数据存储到另一个表中 - micosoft文档在这里http://msdn.microsoft.com/en-gb/library/aa258254(v=sql.80).aspx [ ^ ]。



您可以在加载之前将整个表复制到另一个备份表,但我不推荐它(多个用户的影响,性能等) 。



对Memento Design模式的一些研究也可能有用 - 这里是一个示例文章

Memento Design Pattern [ ^ ]
Firstly into using tranactions - http://www.sqlteam.com/article/introduction-to-transactions[^] and the microsoft documentation here http://msdn.microsoft.com/en-us/library/ms174377.aspx[^]

However, you seem to be implying that the user can make this choice for themselves (compared to something going wrong during the load) so you may want to use triggers to store away the pre-post data onto another table - micosoft documentation here http://msdn.microsoft.com/en-gb/library/aa258254(v=sql.80).aspx[^].

You could just copy the entire table to another "backup" table prior to the load but I wouldn''t recommend it (impact of multiple users, performance etc).

Some research into the Memento Design pattern may also prove useful - here''s an example article
Memento Design Pattern[^]


这篇关于表级为最终用户备份和还原的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆