ADMIN_GetTableColumns

 Show all Hide all

Deprecated.

Returns a list of the columns contained in a given table (including temporary tables).

This list includes information about the following:

  • The column order
  • Each columns name, datatype and nullability
  • Whether a column is an identity column
  • Whether a column is computed
  • Whether a column is included in the tables primary key, and if such also its ordinal and sort order
Type: Table-valued function
Area of use: General use

Parameters:

@TableName mandatory sysname
The name of the table for which to return column information.

Resultsets:

Resultset: Columns

Repeat mode: repeated exactly once
Row count: one or more rows

Columns:

Ordinal mandatory int
The column position in the table
Name mandatory sysname
The column name
Datatype mandatory string
The column datatype
IsNullable mandatory bit
If the column allows storing null-values
IsIdentity mandatory bit
If the column is an identity column
IsComputed mandatory bit
If the column is computed
PrimaryKeyOrdinal mandatory tinyint
The column position in the tables primary key
PrimaryKeySortOrder mandatory string
The column sort order if included in the primary key