#
DataType
DataType
DataType
Enum

## Definition

Indicates the data type of columns in data flow components and the data flow buffer.

`public enum class DataType`

`public enum DataType`

`Public Enum DataType`

- Inheritance

## Fields

DT_BOOL DT_BOOL DT_BOOL | 11 | A Boolean value. The numeric value is 11. |

DT_BYREF_BOOL DT_BYREF_BOOL DT_BYREF_BOOL | 16395 | A pointer to a Boolean value. The numeric value is 16395. |

DT_BYREF_CY DT_BYREF_CY DT_BYREF_CY | 16390 | A pointer to a currency value. This data type is an 8-byte value with a scale of 4 and a maximum precision of 19. The numeric value is 16390. |

DT_BYREF_DATE DT_BYREF_DATE DT_BYREF_DATE | 16391 | A pointer to a date structure that consists of year, month, date, and hour. The numeric value is 16391. |

DT_BYREF_DBDATE DT_BYREF_DBDATE DT_BYREF_DBDATE | 16517 | A pointer to a date structure that consists of year, month, and date. The numeric value is 16517. |

DT_BYREF_DBTIME DT_BYREF_DBTIME DT_BYREF_DBTIME | 16518 | A pointer to a time structure that consists of hour, minute, and second. The numeric value is 16518. |

DT_BYREF_DBTIME2 DT_BYREF_DBTIME2 DT_BYREF_DBTIME2 | 16520 | A pointer to a time structure that consists of hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. The numeric value is 16520. |

DT_BYREF_DBTIMESTAMP DT_BYREF_DBTIMESTAMP DT_BYREF_DBTIMESTAMP | 16519 | A pointer to a timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 3 digits. The numeric value is 16519. |

DT_BYREF_DBTIMESTAMP2 DT_BYREF_DBTIMESTAMP2 DT_BYREF_DBTIMESTAMP2 | 16522 | A pointer to a timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. The numeric value is 16522. |

DT_BYREF_DBTIMESTAMPOFFSET DT_BYREF_DBTIMESTAMPOFFSET DT_BYREF_DBTIMESTAMPOFFSET | 16521 | A pointer to a timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. |

DT_BYREF_DECIMAL DT_BYREF_DECIMAL DT_BYREF_DECIMAL | 16398 | A pointer to an exact numeric value with a fixed precision and a fixed scale. This data type is a 12-byte value with a separate sign, a scale of 0 to 28, and a maximum precision of 29. The numeric value is 16398. |

DT_BYREF_FILETIME DT_BYREF_FILETIME DT_BYREF_FILETIME | 16448 | A pointer to a 64-bit value that represents the number of 100-nanosecond intervals since January 1, 1601. The numeric value is 16448. |

DT_BYREF_GUID DT_BYREF_GUID DT_BYREF_GUID | 16456 | A pointer to a GUID. The numeric value is 16456. |

DT_BYREF_I1 DT_BYREF_I1 DT_BYREF_I1 | 16400 | A pointer to a 1-byte, signed integer. The numeric value is 16400. |

DT_BYREF_I2 DT_BYREF_I2 DT_BYREF_I2 | 16386 | A pointer to a 2-byte, signed integer. The numeric value is 16386. |

DT_BYREF_I4 DT_BYREF_I4 DT_BYREF_I4 | 16387 | A pointer to a 4-byte, signed integer. The numeric value is 16387. |

DT_BYREF_I8 DT_BYREF_I8 DT_BYREF_I8 | 16404 | A pointer to an 8-byte, signed integer. The numeric value is 16404. |

DT_BYREF_NUMERIC DT_BYREF_NUMERIC DT_BYREF_NUMERIC | 16515 | A pointer to an exact numeric value with a fixed precision and scale. This data type is a 16-byte value with a separate sign, a scale of 0 to 38, and a maximum precision of 38. The numeric value is 16515. |

DT_BYREF_R4 DT_BYREF_R4 DT_BYREF_R4 | 16388 | A pointer to a single-precision floating-point value. The numeric value is 16388. |

DT_BYREF_R8 DT_BYREF_R8 DT_BYREF_R8 | 16389 | A pointer to a double-precision floating-point value. The numeric value is 16389. |

DT_BYREF_UI1 DT_BYREF_UI1 DT_BYREF_UI1 | 16401 | A pointer to a 1-byte, unsigned integer. The numeric value is 16401. |

DT_BYREF_UI2 DT_BYREF_UI2 DT_BYREF_UI2 | 16402 | A pointer to a 2-byte, unsigned integer. The numeric value is 16402. |

DT_BYREF_UI4 DT_BYREF_UI4 DT_BYREF_UI4 | 16403 | A pointer to a 4-byte, unsigned integer. The numeric value is 16403. |

DT_BYREF_UI8 DT_BYREF_UI8 DT_BYREF_UI8 | 16405 | A pointer to an 8-byte, unsigned integer. The numeric value is 16405. |

DT_BYTES DT_BYTES DT_BYTES | 128 | A binary data value. The length is variable and the maximum length is 8,000 bytes. The numeric value is 128. |

DT_CY DT_CY DT_CY | 6 | A currency value. This data type is an 8-byte value with a scale of 4 and a maximum precision of 19. The numeric value is 6. |

DT_DATE DT_DATE DT_DATE | 7 | A date structure that consists of year, month, day, and hour. |

DT_DBDATE DT_DBDATE DT_DBDATE | 133 | A date structure that consists of year, month, and date. The numeric value is 133. |

DT_DBTIME DT_DBTIME DT_DBTIME | 134 | A time structure that consists of hour, minute, and second. The numeric value is 134. |

DT_DBTIME2 DT_DBTIME2 DT_DBTIME2 | 145 | A time structure that consists of hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. The numeric value is 145. |

DT_DBTIMESTAMP DT_DBTIMESTAMP DT_DBTIMESTAMP | 135 | A timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 3 digits. The numeric value is 135. |

DT_DBTIMESTAMP2 DT_DBTIMESTAMP2 DT_DBTIMESTAMP2 | 304 | A timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. The numeric value is 304. |

DT_DBTIMESTAMPOFFSET DT_DBTIMESTAMPOFFSET DT_DBTIMESTAMPOFFSET | 146 | A timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits. |

DT_DECIMAL DT_DECIMAL DT_DECIMAL | 14 | An exact numeric value with a fixed precision and a fixed scale. This data type is a 12-byte value with a separate sign, a scale of 0 to 28, and a maximum precision of 29. The numeric value is 14. |

DT_EMPTY DT_EMPTY DT_EMPTY | 0 | A data type that does not have a value. The numeric value is 0. |

DT_FILETIME DT_FILETIME DT_FILETIME | 64 | A 64-bit value that represents the number of 100-nanosecond intervals since January 1, 1601. The numeric value is 64. |

DT_GUID DT_GUID DT_GUID | 72 | A globally unique identifier (GUID). The numeric value is 72. |

DT_I1 DT_I1 DT_I1 | 16 | A 1-byte, signed integer. The numeric value is 16. |

DT_I2 DT_I2 DT_I2 | 2 | A 2-byte, signed integer. The numeric value is 2. |

DT_I4 DT_I4 DT_I4 | 3 | A 4-byte, signed integer. The numeric value is 3. |

DT_I8 DT_I8 DT_I8 | 20 | An 8-byte, signed integer. The numeric value is 20. |

DT_IMAGE DT_IMAGE DT_IMAGE | 301 | A binary value with a maximum size of 231–1 (2,147,483,647) bytes. The numeric value is 301. |

DT_NTEXT DT_NTEXT DT_NTEXT | 303 | A Unicode character string with a maximum length of 2^30–1 (1,073,741,823) characters. The numeric value is 303. |

DT_NULL DT_NULL DT_NULL | 1 | A data type with a value of |

DT_NUMERIC DT_NUMERIC DT_NUMERIC | 131 | An exact numeric value with a fixed precision and scale. This data type is a 16-byte value with a separate sign, a scale of 0 to 38, and a maximum precision of 38. The numeric value is 131. |

DT_R4 DT_R4 DT_R4 | 4 | A single-precision floating-point value. The numeric value is 4. |

DT_R8 DT_R8 DT_R8 | 5 | A double-precision floating-point value. The numeric value is 5. |

DT_STR DT_STR DT_STR | 129 | A null-terminated ANSI/MBCS character string. The numeric value is 129. |

DT_TEXT DT_TEXT DT_TEXT | 302 | An ANSI/MBCS character string with a maximum length of 231–1 (2,147,483,647) characters. The numeric value is 302. |

DT_UI1 DT_UI1 DT_UI1 | 17 | A 1-byte, unsigned integer. The numeric value is 17. |

DT_UI2 DT_UI2 DT_UI2 | 18 | A 2-byte, unsigned integer. The numeric value is 18. |

DT_UI4 DT_UI4 DT_UI4 | 19 | A 4-byte, unsigned integer. The numeric value is 19. |

DT_UI8 DT_UI8 DT_UI8 | 21 | An 8-byte, unsigned integer. The numeric value is 21. |

DT_WSTR DT_WSTR DT_WSTR | 130 | A null-terminated Unicode character string. The numeric value is 130. |

## Remarks

Data types are divided into reference types and value types. Reference types point to an object of the specified type. Value types contain the actual data, not a pointer to the data.

For those data types that are value types, there are times where you need a pointer to their data, not the data itself. In the member table, the DT_BYREF* members are fields that were created to be pointers to value types.

For more information, see Working with Data Types in the Data Flow.

Note

Boolean values are logical values, not numbers. Although Boolean values may be displayed as numbers in some environments, they are not stored as numbers, and various programming languages represent Boolean values as numeric values differently, as do the .NET Framework methods.

For example, the conversion functions available in Visual Basic convert `True`

to -1; however, the `System.Convert.ToInt32`

method in the .NET Framework converts `True`

to +1. The Integration Services Expression Language converts `True`

to -1.

To avoid errors or unexpected results, you should not write code that relies on particular numeric values for `True`

and `False`

. Wherever possible, you should restrict usage of Boolean variables to the logical values for which they are designed.

For more information about data types, see Integration Services Data Types.