Error 8102

Severity Level 16

Message Text

Illegal attempt to update identity column '%.*s'

Explanation

You have specifically attempted to alter the value of an identity column in the set portion of the update statement. You can only use the identity column in the where clause of the update statement.

Action

Updating of the identity column is not allowed. To update an identity column, you can use the following techniques:

To reassign all identity values, bcp the data out, drop and recreate the table with the proper seed and increment values. Then bcp the data back into the newly created table. When bcp inserts the values it will appropriately increase the values and redistribute the identity values. You can also use the INSERT INTO and sp_rename commands to accomplish the same action.

To reassign a single row you must delete the row and insert it using the SET IDENTITY_INSERT tblName ON option.