Click here to Skip to main content
13,144,309 members (32,245 online)
Rate this:
Please Sign up or sign in to vote.
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.
Posted 1-May-13 2:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Firstly into using tranactions -[^] and the microsoft documentation here[^]

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[^].

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[^]

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100