Share via


DataType Enum

Definition

public enum class DataType
public enum DataType
type DataType = 
Public Enum DataType
Inheritance
DataType

Fields

Name Value Description
DT_EMPTY 0
DT_NULL 1
DT_I2 2
DT_I4 3
DT_R4 4
DT_R8 5
DT_CY 6
DT_DATE 7
DT_BOOL 11
DT_DECIMAL 14
DT_I1 16
DT_UI1 17
DT_UI2 18
DT_UI4 19
DT_I8 20
DT_UI8 21
DT_FILETIME 64
DT_GUID 72
DT_BYTES 128
DT_STR 129
DT_WSTR 130
DT_NUMERIC 131
DT_DBDATE 133
DT_DBTIME 134
DT_DBTIMESTAMP 135
DT_DBTIME2 145
DT_DBTIMESTAMPOFFSET 146
DT_IMAGE 301
DT_TEXT 302
DT_NTEXT 303
DT_DBTIMESTAMP2 304
DT_BYREF_I2 16386
DT_BYREF_I4 16387
DT_BYREF_R4 16388
DT_BYREF_R8 16389
DT_BYREF_CY 16390
DT_BYREF_DATE 16391
DT_BYREF_BOOL 16395
DT_BYREF_DECIMAL 16398
DT_BYREF_I1 16400
DT_BYREF_UI1 16401
DT_BYREF_UI2 16402
DT_BYREF_UI4 16403
DT_BYREF_I8 16404
DT_BYREF_UI8 16405
DT_BYREF_FILETIME 16448
DT_BYREF_GUID 16456
DT_BYREF_NUMERIC 16515
DT_BYREF_DBDATE 16517
DT_BYREF_DBTIME 16518
DT_BYREF_DBTIMESTAMP 16519
DT_BYREF_DBTIME2 16520
DT_BYREF_DBTIMESTAMPOFFSET 16521
DT_BYREF_DBTIMESTAMP2 16522

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.

The DT_DATE data type is implemented using an 8-byte floating-point number. Days are represented by whole number increments, starting with 30 December 1899, and midnight as time zero. Hour values are expressed as the absolute value of the fractional part of the number. This means that DT_DATE can represent minutes, seconds, and even milliseconds as well. However, floating point value cannot represent all real values; therefore, there are limits on the range of dates that can be presented in DT_DATE.

The DT_DBTIMESTAMPOFFSET data type also has a time zone offset. This offset specifies the number of hours and minutes that the time is offset from the Coordinated Universal Time (UTC). The time zone offset is used by the system to obtain the local time.

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

Applies to