Type mapping rules from this table are used when Visual Studio Entity Data Model Wizard generates an EDM model from a Database.
Teradata Data Type | EDM Primitive Type (CSDL) | .NET Data Type | Notes | ||||
---|---|---|---|---|---|---|---|
Blob | Binary | System.Byte[] | |||||
Byte | Binary | System.Byte[] | |||||
ByteInt | Int16 | System.Int16 | |||||
ByteInt * | Boolean | System.Boolean | Teradata does not natively support a Boolean type. SSDL must be manually modified to enable Teradata ByteInt to Boolean Type mapping. Precision Facet must be set 1 as shown below:
| ||||
BigInt | Int64 | System.Int64 | |||||
Date | DateTime | System.DateTime | |||||
Decimal | Decimal | System.Decimal | |||||
Double | Double | System.Double | |||||
Double Precision | Double | System.Double | |||||
Float | Double | System.Double | |||||
Integer | Int32 | System.Int32 | |||||
Interval Day | Time | System.TimeSpan | Teradata Interval Day supports maximum 9,999 Days. | ||||
Interval Day To Hour | Time | System.TimeSpan | |||||
Interval Day To Minute | Time | System.TimeSpan | |||||
Interval Day To Second | Time | System.TimeSpan | |||||
Interval Hour | Time | System.TimeSpan | |||||
Interval Hour To Minute | Time | System.TimeSpan | |||||
Interval Hour To Second | Time | System.TimeSpan | |||||
Interval Minute | Time | System.TimeSpan | |||||
Interval Minute To Second | Time | System.TimeSpan | |||||
Interval Second | Time | System.TimeSpan | Teradata Interval Second supports up to six fractional seconds (sub-seconds). | ||||
Char | String | System.String | |||||
Clob | String | System.String | |||||
Graphic | String | System.String | |||||
Interval Month | String | System.String | |||||
Interval Year | String | System.String | |||||
Interval Year To Month | String | System.String | |||||
Number | Double | System.Double | Teradata Database 14.0 feature. | ||||
Period Date | String | System.String | Teradata Database 13.0 feature. | ||||
Period Time | String | System.String | Teradata Database 13.0 feature. | ||||
Period Timestamp | String | System.String | Teradata Database 13.0 feature. | ||||
Period Timestamp With Time Zone | String | System.String | Teradata Database 13.0 feature. | ||||
Period Time With Time Zone | String | System.String | Teradata Database 13.0 feature. | ||||
Real | Double | System.Double | |||||
SmallInt | Int16 | System.Int16 | |||||
Time | Time | System.TimeSpan | |||||
Timestamp | DateTime | System.DateTime | |||||
Timestamp With Time Zone | DateTimeOffset | System.DateTimeOffset | |||||
Time With Time Zone | String | System.String | |||||
VarByte | Binary | System.Byte[] | |||||
VarChar | String | System.String | |||||
VarGraphic | String | System.String | |||||
Xml | String | System.String | Teradata Database 14.10 feature. | ||||
JSON | String | System.String | Teradata Database 15.0 feature. |
SQL Data Type | SSDL Type Name (Case Sensitive) | Facet Name | Facet Value |
---|---|---|---|
Blob | blob | MaxLength | Minimum: 1 Maximum: 2,097,088,000 Default Value: 1 |
Byte | byte | MaxLength | Minimum: 1 Maximum: 64,000 Default Value: 1 |
FixedLength | Default Value: true | ||
ByteInt | byteint | Precision | Minimum: 1 Maximum: 3 Default Value: 3 |
BigInt | bigint | ||
Date | date | Precision | Default Value: 0 |
Decimal | decimal | Precision | Minimum: 1 Maximum: 38 Default Value: 18 |
Scale | Minimum: 0 Maximum: 38 Default Value: 0 | ||
Double | double precision | ||
Double Precision | double precision | ||
Float | double precision | ||
Integer | integer | ||
Interval Day | interval day | ||
Interval Day To Hour | interval day to hour | ||
Interval Day To Minute | interval day to minute | ||
Interval Day To Second | interval day to second | Precision | Minimum: 0 Maximum: 6 Default Value: 6 |
Interval Hour | interval hour | ||
Interval Hour To Minute | interval hour to minute | ||
Interval Hour To Second | interval hour to second | ||
Interval Minute | interval minute | ||
Interval Minute To Second | interval minute to second | ||
Interval Second | interval second | Precision | Minimum: 0 Maximum: 6 Default Value: 6 |
Char | char | MaxLength | Minimum: 1 Maximum: 64,000 Default Value: 1 |
FixedLength | Default Value: true | ||
Clob | clob | MaxLength | Minimum: 1 Maximum: 2,097,088,000 Default Value: 2,097,088,000 |
FixedLength | Default Value: True | ||
Graphic | graphic | MaxLength | Minimum: 1 Maximum: 32,000 Default Value: 1 |
FixedLength | true | ||
Interval Month | interval month | MaxLength | Minimum: 2 Maximum: 5 Default Value: 3 |
FixedLength | Default Value: false | ||
Interval Year | interval year | MaxLength | Minimum: 2 Maximum: 5 Default Value: 2 |
FixedLength | Default Value: false | ||
Interval Year To Month | interval year to month | MaxLength | Minimum: 5 Maximum: 8 Default Value: 6 |
FixedLength | Default Value: false | ||
Number | double precision | ||
Period Date | period date | MaxLength | Minimum: 24 Maximum: 24 Default Value: 24 |
FixedLength | Default Value: true | ||
Period Time | period time | MaxLength | Minimum: 20 Maximum: 34 Default Value: 20 |
FixedLength | Default Value: true | ||
Period Timestamp | period timestamp | MaxLength | Minimum: 42 Maximum: 56 Default Value: 42 |
FixedLength | Default Value: true | ||
Period Timestamp With Time Zone | period timestamp with time zone | MaxLength | Minimum: 54 Maximum: 68 Default Value: 54 |
FixedLength | Default Value: true | ||
Period Time With Time Zone | period time with time zone | MaxLength | Minimum: 32 Maximum: 46 Default Value: 32 |
FixedLength | Default Value: true | ||
Real | double precision | ||
SmallInt | smallint | ||
Time | time | Precision | Minimum: 0 Maximum: 6 Default Value: 6 |
Timestamp | timestamp | Precision | Minimum: 0 Maximum: 6 Default Value: 6 |
Timestamp With Time Zone | timestamp with time zone | Precision | Minimum: 0 Maximum: 6 Default Value: 6 |
Time With Time Zone | time with time zone | MaxLength | Minimum: 14 Maximum: 21 Default Value: 14 |
FixedLength | Default Value: true | ||
VarByte | varbyte | MaxLength | Minimum: 1 Maximum: 64,000 Default Value: 1 |
FixedLength | Default Value: false | ||
VarChar | varchar | MaxLength | Minimum: 1 Maximum: 64,000 Default Value: 1 |
FixedLength | Default Value: false | ||
VarGraphic | vargraphic | MaxLength | Minimum: 1 Maximum: 64,000 Default Value: 1 |
FixedLength | Default Value: false | ||
Xml | xml | MaxLength | Minimum: 1 Maximum: 2,097,088,000 Default Value: 2,097,088,000 |
FixedLength | Default Value: false | ||
JSON | json | MaxLength | Minimum: 1 Maximum: 16,776,192 Default Value: 16,776,192 |
FixedLength | Default Value: False |
.NET Framework Data Type | EDM Primitive Type (CSDL) | Teradata Data Type |
---|---|---|
System.Boolean | Boolean | ByteInt |
System.Byte | Byte | SmallInt |
System.Byte[] | Binary | Blob Note: Binary length is greater than 64,000. |
System.Byte[] | Binary | VarByte Note: Binary length is less than or equal to 64,000. |
System.DateTime | DateTime | Timestamp |
System.DateTimeOffset | DateTimeOffset | Timestamp With Time Zone |
System.Decimal | Decimal | Decimal |
System.Double | Double | Double |
System.Guid | Guid | NOT SUPPORTED |
System.Int16 | Int16 | SmallInt |
System.Int32 | Int32 | Integer |
System.Int64 | Int64 | BigInt |
System.SByte | SByte | ByteInt |
System.Single | Single | Float |
System.String | String | Clob Note: String length is greater than 64,000. |
System.String | String | VarChar Note: String length is less than or equal to 64,000. |
System.TimeSpan | Time | Time |
Please note that Teradata Entity Provider uses asymmetric type mapping. That is, the EDM-to-provider type mapping for some types are different from provider-to-EDM type mapping. For example, the following store types all map to EDM.Time (which corresponds to System.TimeSpan):
However, the default store type for EDM.Time is Teradata type Time. This is one example where an EDM type does not always round-trip to the same Teradata type. Unfortunately, this can cause problems for the Entity Provider when it is processing parameters.
Refer to Working With Parameters for more information on the special handling performed by the Entity Provider when processing parameters for EDM types that are asymmetrically mapped.