sp_columns

Returns information about the type of data that can be stored in one or more columns.

Syntax

sp_columns table_name [, table_owner]
 [, table_qualifier] [, column_name]

Parameters

Usage

  • This procedure returns the Adaptive Server datatype that most clearly matches the native datatype of the target, regardless of the current datatype properties.

  • This procedure corresponds to the ODBC function SQLColumns.

  • This procedure returns one row containing a description of each column in a table.
    • There are three columns in the result set that describe each datatype; TYPE_NAME, DATA_TYPE, and REMOTE_DATA_TYPE.

    • TYPE_NAME contains the ODBC datatype name and DATA_TYPE contains the ODBC integer identifier.

    • The REMOTE_DATA_TYPE column contains a 32-bit or 4-byte composite user datatype UDT specifically identifying the remote datatype.

    This procedure allows transmission of column datatypes using a target-specific-type ID. The REMOTE_DATA_TYPE column contains a 32-bit composite datatype defined by the access service.