Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Alternate for Delete and Insert Approach

Author  Topic 

vijayakumar_svk
Yak Posting Veteran

50 Posts

Posted - 2012-08-27 : 08:08:09
I have a Table relationships like below..

TableA (1 Row ) - Master
TableB (eg: 2000 rows) refers (Many to one) TableBA (eg: 1500 rows)

TableC (eg: 10000 rows) Referes (Many to One) Table B and TableCA (Many to one) (eg: 5000 rows)

We are getting the data from outside source so whenever we get a data we will get a whole set. It is difficult to identify the Delta part (added/modified/deleted) so we are deleting all the records from the child tables and reinserting it. This happens record by record. This is a time consuming process so we are looking at a alternate solution without changing the DB structure.

I would appreciate any one suggest a alternate solution.

Thanks in Advance..


==============================
Work smarter not harder take control of your life be a super achiever

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-27 : 11:44:40
do you've audit trail columns (dateadded,datemodified etc) in all tables? or a sequetial id column?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vijayakumar_svk
Yak Posting Veteran

50 Posts

Posted - 2012-08-28 : 08:44:06
I have a unique varchar field in the Master table. All the remaining tables has an Identity column.

==============================
Work smarter not harder take control of your life be a super achiever
Go to Top of Page
   

- Advertisement -