共用方式為


IdentityIncrement Property

未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。

The IdentityIncrement property exposes the value that Microsoft SQL Server adds to the maximum existing row identity value as it generates the next identity value.

語法

object.IdentityIncrement [=value]

Parts

  • object
    An expression that evaluates to an object in the Applies To list

  • value
    A long integer greater than or equal to 1

Data Type

Long

Modifiable

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

Prototype (C/C++)

HRESULT GetIdentityIncrement(LPLONG pRetVal);
HRESULT SetIdentityIncrement(LONG NewValue);

備註

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.

For example, the identity values for the first three rows inserted into a table containing a column defined with row identity, an identity seed of 1, and an increment value of 3, are 1, 4, and 7.

Applies To: