Solved

What is the best SQL server practice for editing a document that affects multiple tables/rows?

Posted on 2014-03-02
1
201 Views
Last Modified: 2014-03-06
Hi,

I have an application in VB6 that is being migrated from dBAse IV to SQL Server 2008 R2 database.  There are several 'documents' that are organized into a header table and detail table where the detail table has multiple records.  

When the 'document' is edited,  some of the rows from the detail could have been deleted, some added, or some just changed.

What is the best practice for doing this type of work?

1 - update each record based on the record's unique key and then delete any record that isn't in the document anymore?

2 - delete all records and re-insert only the rows in the document?

Thanks for your input!
0
Comment
Question by:lthames
1 Comment
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 39899554
2.  Is a lot easier to accomplish.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question