The ColumnType property returns the base data type of a column in the current result set of a QueryResults object.
object.ColumnType( OrdinalColumn )
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list |
OrdinalColumn | Long integer specifying the column in the results by position |
The value returned by ColumnType is evaluated by using these values.
Constant | Value | Description |
---|---|---|
SQLDMO_DTypeBinary | -2 | Fixed length binary data. |
SQLDMO_DTypeBit | -7 | Unsigned integer data. The width of the integer is one byte. |
SQLDMO_DTypeChar | 1 | Fixed length character. |
SQLDMO_DTypeDateTime | -2 | ODBC SQL_TIMESTAMP_STRUCT. |
SQLDMO_DTypeDateTime4 | 93 | ODBC SQL_TIMESTAMP_STRUCT. |
SQLDMO_DTypeFloat4 | 7 | Approximate numeric data. The width of the numeric value is four bytes. |
SQLDMO_DTypeFloat8 | 8 | Approximate numeric data. The width of the numeric value is eight bytes. |
SQLDMO_DTypeGUID | -11 | Globally unique identifier (GUID). The data is a data structure 16 bytes in length. |
SQLDMO_DTypeImage | -4 | Long, variable length binary data. |
SQLDMO_DTypeInt1 | -6 | Unsigned integer data. The width of the integer is one byte. |
SQLDMO_DTypeInt2 | 5 | Signed integer data. The width of the integer is two bytes. |
SQLDMO_DTypeInt4 | 4 | Signed integer data. The width of the integer is four bytes. |
SQLDMO_DTypeMoney4 | 3 | Scaled integer data represented as a string value. |
SQLDMO_DTypeMoney | 3 | Scaled integer data represented as a string value. |
SQLDMO_DTypeNText | -10 | Long, variable length, Unicode character data. |
SQLDMO_DTypeText | -1 | Long, variable length character data. |
SQLDMO_DTypeUChar | -8 | Fixed length, Unicode character data. |
SQLDMO_DTypeUnknown | 0 | Bad or not supported data type value. |
SQLDMO_DTypeUVarchar | -9 | Variable length, Unicode character data. |
SQLDMO_DTypeVarBinary | -3 | Variable length binary data. |
SQLDMO_DTypeVarchar | 12 | Variable length character data. |
Long, enumerated
Read-only
HRESULT GetColumnType(long nColumn,
SQLDMO_QUERY_DATATYPE* pRetVal);