Send feedback on this topic.
Teradata.Client.Provider
How SQL Statements Are Sent to the Teradata Database
.NET Data Provider for Teradata > Developer's Guide > Working with the Data Provider Features > TdCommandBuilder and TdDataAdapter Overview > Batch Update > How SQL Statements Are Sent to the Teradata Database

Based on the value of the UpdateBatchSize, the TdDataAdapter will determine how the SQL-Statements will be sent to the Teradata Database. One of three methods is used:

  1. Single-Statement Request: The SQL Statements are sent to the Teradata Database one at a time when UpdateBatchSize is set to 1.
  2. Multi-Statement Request: Two or more SQL Statements separated by semicolons are sent to the Teradata Database in one Request when UpdateBatchSize is set to 0 or to a number greater than 1. The number of SQL-Statements included in the Multi-Statement Request is limited by:
    • The maximum number of Parameters in one Request: approximately 2,500.
    • The maximum length of data and SQL-Text associated with one Request: approximately 1MB although, Teradata Database version 16.0 has increased that limit.
    Refer to the "Teradata System Limits" [Appendix B] section of the Teradata Database Design guide for the exact limits.
  3. Iterated Requests (a.k.a. Parameter Array): A single SQL-Statement with multiple rows of data is sent to the Teradata Database when UpdateBatchSize is set to 0 or to a number greater than 5.
    The request size limit mentioned above for Multi-Statement Request is also applicable to Iterated Requests but there is more room for Data, since the SQL-Text (CommandText) for a single SQL-Statement takes up less space within that Request.
    There is also a limit of 64,000 rows per request for Teradata Database 16.0, or 16,383 rows for earlier database versions.

The TdDataAdapter determines whether the SQL statements will be sent as a Multi-Statement or Iterated request using the following rules:

In summary the Data Provider uses an internal algorithm to select Iterated Request vs. Multi-Statement Request when a) KeepCommandBatchSequence is set to false and b) TdCommandBuilder is used to generate DML statements or TdParameter properties (TdType, Size, Precision and Scale) are set correctly.