sp_special_columns

Returns the optimal set of columns that uniquely identify a row in a table or view; can also return a list of timestamp columns, with values that are automatically generated when any value in the row is updated by a transaction.

Syntax

sp_special_columns table_name [, table_owner] 
	[, table_qualifier] [, col_type]

Parameters

Examples

Usage

The results set for sp_special_columns is:

Column

Datatype

Description

scope

int

NOT NULL. Actual scope of the row ID. The SAP ASE server always returns 0.

column_name

varchar(30)

NOT NULL. Column identifier.

data_type

smallint

The integer code for an ODBC datatype. If this datatype cannot be mapped to an ANSI/ISO type, the value is NULL. The native datatype name is returned in the type_name column.

type_name

varchar(13)

The string representation of the datatype. This is the datatype name as presented by the underlying DBMS.

precision

int

The number of significant digits.

length

int

The length in bytes of the datatype.

scale

smallint

The number of digits to the right of the decimal point.

Permissions

Any user can execute sp_special_columns.