TechNet
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

sys.identity_columns (Transact-SQL)

 

THIS TOPIC APPLIES TO: yesSQL Server (starting with 2008)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Contains a row for each column that is an identity column.

The sys.identity_columns view inherits rows from the sys.columns view. The sys.identity_columns view returns the columns in the sys.columns view, plus the seed_value, increment_value, last_value, and is_not_for_replication columns. For more information, see Catalog Views (Transact-SQL).

Column nameData typeDescription
<columns inherited from sys.columns>The sys.identity_columns view returns all columns in the sys.columns view. It also returns the additional columns described below. For a description of the columns that the sys.identity_columns view inherits from sys.columns, see sys.columns (Transact-SQL).
seed_valuesql_variantSeed value for this identity column. The data type of the seed value is the same as the data type of the column itself.
increment_valuesql_variantIncrement value for this identity column. The data type of the seed value is the same as the data type of the column itself.
last_valuesql_variantLast value generated for this identity column. The data type of the seed value is the same as the data type of the column itself.
is_not_for_replicationbitIdentity column is declared NOT FOR REPLICATION.
System_CAPS_ICON_note.jpg Note


To create an automatically incrementing number that can be used in multiple tables or that can be called from applications without referencing any table, see Sequence Numbers.

The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. For more information, see Metadata Visibility Configuration.

Object Catalog Views (Transact-SQL)
Catalog Views (Transact-SQL)
Querying the SQL Server System Catalog FAQ

Community Additions

ADD
Show:
© 2016 Microsoft