3
votes

I am wondering, how the TClientDataSet is executing the SQL statment when ApplyUpdates is invoked.

If there is more than one record changed, is the update SQL query prepared and sent for each record as single SQL statment or is there maybe a SQL 'script' created and than sent at once to the database?

I mean, is there a performance difference, when I ApplyUpdates on very record change in contrast to ApplyUpdates for all changes at once?

1

1 Answers

7
votes

No SQL is sent from the client, only the delta packet. The provider on the server receives the delta packet and generates insert/update/delete SQL statements based on it. Sending multiple updates in a single request usually leads to better performance.