Link to home
Start Free TrialLog in
Avatar of Lynn Thames
Lynn ThamesFlag for United States of America

asked on

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

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!
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial