Export (0) Print
Expand All
Expand Minimize

DataType Enumeration

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

Namespace:  Microsoft.SqlServer.Dts.Runtime.Wrapper
Assembly:  Microsoft.SqlServer.DTSRuntimeWrap (in Microsoft.SqlServer.DTSRuntimeWrap.dll)

public enum DataType

Member nameDescription
DT_EMPTYA data type that does not have a value.
DT_NULLA data type with a value of NULL.
DT_I2A 2-byte, signed integer.
DT_I4A 4-byte, signed integer.
DT_R4A single-precision floating-point value.
DT_R8A double-precision floating-point value.
DT_CYA currency value. This data type is an 8-byte value with a scale of 4 and a maximum precision of 19.
DT_DATEA date structure that consists of year, month, day, and hour.

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.

On the other hand, DT_DBTIMESTAMP is represented by a structure that has individual fields for year, month, day, hours, minutes, seconds, and milliseconds, and this data type has no limits on ranges of the dates it can present.

DT_BOOLA Boolean value.
DT_DECIMALAn 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.
DT_I1A 1-byte, signed integer.
DT_UI1A 1-byte, unsigned integer.
DT_UI2A 2-byte, unsigned integer.
DT_UI4A 4-byte, unsigned integer.
DT_I8An 8-byte, signed integer.
DT_UI8An 8-byte, unsigned integer.
DT_FILETIMEA 64-bit value that represents the number of 100-nanosecond intervals since January 1, 1601.
DT_GUIDA globally unique identifier (GUID).
DT_BYTESA binary data value. The length is variable and the maximum length is 8,000 bytes.
DT_STRA null-terminated ANSI/MBCS character string.
DT_WSTRA null-terminated Unicode character string.
DT_NUMERICAn 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.
DT_DBDATEA date structure that consists of year, month, and date.
DT_DBTIMEA time structure that consists of hour, minute, and second.
DT_DBTIMESTAMPA timestamp structure that consists of year, month, day, hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 3 digits.
DT_DBTIME2A time structure that consists of hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits.
DT_DBTIMESTAMPOFFSETA 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 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.

DT_IMAGEA binary value with a maximum size of 231–1 (2,147,483,647) bytes.
DT_TEXTAn ANSI/MBCS character string with a maximum length of 231–1 (2,147,483,647) characters.
DT_NTEXTA Unicode character string with a maximum length of 2^30–1 (1,073,741,823) characters.
DT_DBTIMESTAMP2A 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_I2A pointer to a 2-byte, signed integer.
DT_BYREF_I4A pointer to a 4-byte, signed integer.
DT_BYREF_R4A pointer to a single-precision floating-point value.
DT_BYREF_R8A pointer to a double-precision floating-point value.
DT_BYREF_CYA pointer to a currency value. This data type is an 8-byte value with a scale of 4 and a maximum precision of 19.
DT_BYREF_DATEA pointer to a date structure that consists of year, month, date, and hour.
DT_BYREF_BOOLA pointer to a Boolean value.
DT_BYREF_DECIMALA 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.
DT_BYREF_I1A pointer to a 1-byte, signed integer.
DT_BYREF_UI1A pointer to a 1-byte, unsigned integer.
DT_BYREF_UI2A pointer to a 2-byte, unsigned integer.
DT_BYREF_UI4A pointer to a 4-byte, unsigned integer.
DT_BYREF_I8A pointer to an 8-byte, signed integer.
DT_BYREF_UI8A pointer to an 8-byte, unsigned integer.
DT_BYREF_FILETIMEA pointer to a 64-bit value that represents the number of 100-nanosecond intervals since January 1, 1601.
DT_BYREF_GUIDA pointer to a GUID.
DT_BYREF_NUMERICA 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.
DT_BYREF_DBDATEA pointer to a date structure that consists of year, month, and date.
DT_BYREF_DBTIMEA pointer to a time structure that consists of hour, minute, and second.
DT_BYREF_DBTIMESTAMPA 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.
DT_BYREF_DBTIME2A pointer to a time structure that consists of hour, minute, second, and fractional seconds. The fractional seconds have a maximum scale of 7 digits.
DT_BYREF_DBTIMESTAMPOFFSETA 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 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.

DT_BYREF_DBTIMESTAMP2A 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.

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.

NoteNote

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.

Community Additions

ADD
Show:
© 2015 Microsoft