Page 1 of 1

Synchronizing set with SQL table

Posted: Thu Dec 30, 2010 1:17 pm
by Technical
Hello there. I have an array which I need to synchronize with SQL table.
The table has two columns - id and text. I need to remove old values from the table and insert new. Don't need updating.

My current sequence:
1) Remove rows which aren't present in the current array
2) Get current table records
3) Go through current records and insert new values

Other way is more simple:
1) Remove all rows
2) Insert array items

Which one is more efficient? Or there is better way?

Re: Synchronizing set with SQL table

Posted: Sat Jan 01, 2011 6:59 am
by Technical
Any suggestions?