sp_iq_reset_identity procedure

Function

Sets the seed of the Identity/Autoincrement column associated with the specified table to the specified value.

Syntax

sp_iq_reset_identity (table_name, table_owner, value)

Usage

Syntax You must specify table_name, table owner, and value.

Permissions

None required.

Description

The Identity/Autoincrement column stores a number that is automatically generated. The values generated are unique identifiers for incoming data. The values are sequential, are generated automatically, and are never reused, even when rows are deleted from the table. The seed value specified replaces the default seed value and persists across database shutdowns and failures.

Example

Example 11

The following example creates an Identity column with a starting seed of 50.:

CREATE TABLE mytable(c1 INT identity)
call sp_iq_reset_identity('mytable', 'dba', 50)

See also

“sp_iqcolumn procedure”