Partager via


Identity Property

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement, et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

The Identity property exposes the Microsoft SQL Server row identity property of a column.

Syntaxe

object
.Identity [=value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list
  • value
    TRUE or FALSE

Data Type

Boolean

Modifiable

Read/write prior to SQL Server column creation. Read-only for existing columns.

Prototype (C/C++)

HRESULT GetIdentity(LPBOOL pRetVal);
HRESULT SetIdentity(BOOL NewValue);

Notes

SQL Server allows the row identity property on a single column within a table. Identity, like a primary key, identifies a row uniquely. SQL Server implements row identification using a numeric value. As rows are inserted, SQL Server generates the row value for an identity column by adding an increment to the existing maximum value.

A SQL Server column with identity must have a numeric data type that can be represented as an integer. For example, columns with the SQL Server data types int and decimal(4, 0) can have identity assigned.

If TRUE, this is, or will be, the single identity column for this table.

If FALSE, this column does not have the row identity property.

Applies To:

Column Object