Error 584

Severity

16

Message text

Explicit value specified for identity field in table '%.*s' when IDENTITY_INSERT is set to OFF.

Explanation

Each table can include one IDENTITY column. IDENTITY columns store sequential numbers that are generated automatically by Adaptive Server. The value of the identity column can uniquely identify each row in a table.

The Adaptive Server query processing option set identity_insert determines whether explicit inserts into a table’s IDENTITY column are allowed. Inserting a value into the IDENTITY column allows you to specify a “seed” value for the column or to restore a row that was deleted in error. Setting identity_insert on allows the table owner, database owner, or System Administrator to explicitly insert a value into an IDENTITY column. Unless a unique index exists on the IDENTITY column, any positive value without regard to uniqueness may be inserted in IDENTITY columns when identity_insert is set to on.

Setting identity_insert off prohibits inserts to IDENTITY columns.

Error 584 is raised if you attempt to insert an explicit value into an IDENTITY column when identity_insert is set to off.

Action

Set identity_insert on before attempting to insert an explicit value into an IDENTITY column. identity_insert should be reset to off once the insert operation is complete.

Additional information

The syntax for setting the identity_insert option is:

1> set identity_insert `<table_name>'  {on | off}
2> go 

Where <table_name> is the base table for the column. Only the table owner, database owner, or System Administrator can set this option.

Versions in which this error is raised

All versions