Send feedback on this topic.
Teradata.Client.Provider
Connection String Attributes Related to Large Decimal
.NET Data Provider for Teradata > Developer's Guide > Data Types > Numeric Data Types > Connection String Attributes Related to Large Decimal

With the introduction of Large Decimals, applications developed with earlier versions of the provider may experience some compatibility issues concerning decimals. The connection attribute Enable TdDecimal will allow applications to enable/disable mapping of DECIMAL with Precision less than or equal to 18 to TdDecimal. The compatibility issue will occur when an older application has set TdDataAdapter.ReturnProviderSpecificTypes to true and expects System.Decimal type columns in the resulting DataTable. In this case, the Enable TdDecimal attribute must be set to false. The connection string would be similar to:

   Data Source = Teradata1; User ID = Tuser; Password = Tpass; Enable TdDecimal = false;

The default for this attribute is true.

Refer to Enabling Provider Specific Types for further information.

Max Decimal Precision

The Max Decimal Precision attribute enables an application to set the maximum precision of DECIMAL data types that will be returned by the SQL Engine. The provider will only use this attribute when connected to Teradata Database V2R6.2 or greater version. It can be set to a value between 18 and 38.

If a version earlier than Teradata Database V2R.6.2 is accessed, the Max Decimal Precision will be 18. If the Max Decimal Precision has been specified in the connection string, it will be ignored.

For example the default behavior of COUNT function has changed in V2R6.2. It returns DECIMAL(38,0) in ANSI mode. An existing application expecting DECIMAL(15,0) can simply set the Max Decimal Precision to 18.

An example of how to specify this attribute is as follows:

    Data Source=Teradata1; User ID = Tuser; Password = Tpass; MaxDecimalPrecision = 35;

The default for this attribute when connected to Teradata Database V2R6.2 or higher version is 38. When connected to a version of Teradata Database below V2R6.2 is 18.