ColumnType Property

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

The ColumnType property returns the base data type of a column in the current result set of a QueryResults object.

Syntax

object.ColumnType(OrdinalColumn)

Parts

  • object
    An expression that evaluates to an object in the Applies To list

  • OrdinalColumn
    A long integer that specifies the column in the results by position

Data Type

Long, enumerated

Modifiable

Read-only

Prototype (C/C++)

HRESULT GetColumnType(long nColumn,
SQLDMO_QUERY_DATATYPE* pRetVal);

Returns

The value returned by ColumnType is evaluated using these SQLDMO_QUERY_DATATYPE values.

Constant

Value

Description

SQLDMO_DtypeBigint

-5

bigint data type.

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_DTypeMoney

3

Scaled integer data represented as a string value.

SQLDMO_DTypeMoney4

3

Scaled integer data represented as a string value.

SQLDMO_DTypeNText

-10

Long, variable length, Unicode character data.

SQLDMO_DTypeSQLVariant

-150

sql_variant data type.

SQLDMO_DTypeText

-1

Long, variable length character data.

SQLDMO_DTypeUChar

-8

Fixed length, Unicode character data.

SQLDMO_DTypeUnknown

0

A data type value that is unsupported or not valid.

SQLDMO_DTypeUVarchar

-9

Variable length, Unicode character data.

SQLDMO_DTypeVarBinary

-3

Variable length binary data.

SQLDMO_DTypeVarchar

12

Variable length character data.

Applies To: