SoftadminGuide.Table_PrimaryKeyColumns

Type: Table-valued function

Returns data about the primary key column(s) of a table.

Parameters

@ObjectId mandatory int
object_id for a table.

Resultsets

Resultset: Columns

Table count: repeated exactly once
Row count: zero or more rows
Columns
Name mandatory sysname

Column name.

column_id mandatory int

column_id from sys.column.

key_ordinal mandatory int

The columns position in the key (as opposed to the table).

user_type_id mandatory int

user_type_id from sys.columns.

max_length mandatory int

max_length from sys.columns.

is_identity mandatory bit

is_identity from sys.columns.