DataType 列舉

指出資料流程元件和資料流程緩衝區中的資料行資料類型。

命名空間:  Microsoft.SqlServer.Dts.Runtime.Wrapper
組件:  Microsoft.SqlServer.DTSRuntimeWrap (在 Microsoft.SqlServer.DTSRuntimeWrap.dll 中)

語法

'宣告
Public Enumeration DataType
'用途
Dim instance As DataType
public enum DataType
public enum class DataType
type DataType
public enum DataType

成員

成員名稱 說明
DT_EMPTY 沒有值的資料類型。數值為 0。
DT_NULL 值為 NULL 的資料類型。數值為 1。
DT_I2 2 位元組、帶正負號的整數。數值為 2。
DT_I4 4 位元組、帶正負號的整數。數值為 3。
DT_R4 單精確度浮點值。數值為 4。
DT_R8 雙精確度浮點值。數值為 5。
DT_CY 貨幣值。此資料類型是含 4 位小數的 8 位元組值,且最大有效位數為 19。數值為 6。
DT_DATE 包含年、月、日和時的日期結構。

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.

The numeric value is 7.

DT_BOOL 布林值。數值為 11。
DT_DECIMAL 具有固定有效位數和固定小數位數的精確數值。此資料類型是具有單獨符號、小數位數為 0 至 28,且最大有效位數為 29 的 12 位元組值。數值為 14。
DT_I1 1 位元組、帶正負號的整數。數值為 16。
DT_UI1 1 位元組、不帶正負號的整數。數值為 17。
DT_UI2 2 位元組、不帶正負號的整數。數值為 18。
DT_UI4 4 位元組、不帶正負號的整數。數值為 19。
DT_I8 8 位元組、帶正負號的整數。數值為 20。
DT_UI8 8 位元組、不帶正負號的整數。數值為 21。
DT_FILETIME 64 位元值,表示自 1601 年 1 月 1 日起 100 奈秒間隔的數目。數值為 64。
DT_GUID 全域唯一識別碼 (GUID)。數值為 72。
DT_BYTES 二進位資料值。長度是變數,且最大長度為 8,000 個位元組。數值為 128。
DT_STR 以 null 結束的 ANSI/MBCS 字元字串。數值為 129。
DT_WSTR 以 null 結束的 Unicode 字元字串。數值為 130。
DT_NUMERIC 具有固定有效位數和小數位數的精確數值。此資料類型是具有單獨符號、小數位數為 0 至 38,且最大有效位數為 38 的 16 位元組值。數值為 131。
DT_DBDATE 包含年、月和日的日期結構。數值為 133。
DT_DBTIME 包含小時、分鐘和秒的時間結構。數值為 134。
DT_DBTIMESTAMP 包含年、月、日、小時、分鐘、秒和小數秒的時間戳記結構。小數秒的最大有效位數為 3 位數。數值為 135。
DT_DBTIME2 包含小時、分鐘、秒和小數秒的時間結構。小數秒的最大有效位數為 7 位數。數值為 145。
DT_DBTIMESTAMPOFFSET 包含年、月、日、小時、分鐘、秒和小數秒的時間戳記結構。小數秒的最大有效位數為 7 位數。

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.

The numeric value is 146.

DT_IMAGE 大小上限為 231–1 (2,147,483,647) 個位元組的二進位值。數值為 301。
DT_TEXT 最大長度為 231–1 (2,147,483,647) 個字元的 ANSI/MBCS 字元字串。數值為 302。
DT_NTEXT 最大長度為 2^30–1 (1,073,741,823) 個字元的 Unicode 字元字串。數值為 303。
DT_DBTIMESTAMP2 包含年、月、日、小時、分鐘、秒和小數秒的時間戳記結構。小數秒的最大有效位數為 7 位數。數值為 304。
DT_BYREF_I2 2 位元組、帶正負號的整數指標。數值為 16386。
DT_BYREF_I4 4 位元組、帶正負號的整數指標。數值為 16387。
DT_BYREF_R4 單精確度浮點值的指標。數值為 16388。
DT_BYREF_R8 雙精確度浮點值的指標。數值為 16389。
DT_BYREF_CY 貨幣值的指標。此資料類型是含 4 位小數的 8 位元組值,且最大有效位數為 19。數值為 16390。
DT_BYREF_DATE 日期結構的指標,包含年、月、日和時。數值為 16391。
DT_BYREF_BOOL 布林值的指標。數值為 16395。
DT_BYREF_DECIMAL 具有固定有效位數和固定小數位數的精確數值指標。此資料類型是具有單獨符號、小數位數為 0 至 28,且最大有效位數為 29 的 12 位元組值。數值為 16398。
DT_BYREF_I1 1 位元組、帶正負號的整數指標。數值為 16400。
DT_BYREF_UI1 1 位元組、不帶正負號的整數指標。數值為 16401。
DT_BYREF_UI2 2 位元組、不帶正負號的整數指標。數值為 16402。
DT_BYREF_UI4 4 位元組、不帶正負號的整數指標。數值為 16403。
DT_BYREF_I8 8 位元組、帶正負號的整數指標。數值為 16404。
DT_BYREF_UI8 8 位元組、不帶正負號的整數指標。數值為 16405。
DT_BYREF_FILETIME 64 位元值的指標,表示自 1601 年 1 月 1 日起 100 奈秒間隔的數目。數值為 16448。
DT_BYREF_GUID GUID 的指標。數值為 16456。
DT_BYREF_NUMERIC 具有固定有效位數和小數位數的精確數值指標。此資料類型是具有單獨符號、小數位數為 0 至 38,且最大有效位數為 38 的 16 位元組值。數值為 16515。
DT_BYREF_DBDATE 日期結構的指標,包含年、月和日。數值為 16517。
DT_BYREF_DBTIME 時間結構的指標,包含小時、分鐘和秒。數值為 16518。
DT_BYREF_DBTIMESTAMP 時間戳記結構的指標,包含年、月、日、小時、分鐘、秒和小數秒。小數秒的最大有效位數為 3 位數。數值為 16519。
DT_BYREF_DBTIME2 時間結構的指標,包含小時、分鐘、秒和小數秒。小數秒的最大有效位數為 7 位數。數值為 16520。
DT_BYREF_DBTIMESTAMPOFFSET 時間戳記結構的指標,包含年、月、日、小時、分鐘、秒和小數秒。小數秒的最大有效位數為 7 位數。

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.

The numeric value is 16521.

DT_BYREF_DBTIMESTAMP2 時間戳記結構的指標,包含年、月、日、小時、分鐘、秒和小數秒。小數秒的最大有效位數為 7 位數。數值為 16522。

備註

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 使用資料流程中的資料類型.

[!附註]

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 資料類型.