Solved

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

Posted on 2014-03-02
1
198 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now