Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

746 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

11 Experts available now in Live!

Get 1:1 Help Now