You cannot use upsized append queries in an Access project in Access 2002 (294923)
The information in this article applies to:
This article was previously published under Q294923 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
For a Microsoft Access 2000 version of this article, see 229681.
SYMPTOMS
When you try to run an upsized append query in a Microsoft Access project, you may receive the following error message:
Cannot insert explicit value for identity column in table 'table name' when IDENTITY_INSERT is set to OFF.
CAUSE
When you create a new SQL Server database (including SQL Server 2000 Desktop Engine), the IDENTITY_INSERT options are set to OFF.
If you upsize a Microsoft Access table that contains a field of the AutoNumber data type, the field is created on SQL Server as an IDENTITY column. Unlike the AutoNumber data type, you cannot directly edit IDENTITY columns, nor explicitly insert data into an IDENTITY column while the IDENTITY_INSERT option for that table is set to OFF. To insert or update data in an IDENTITY column, you must set the IDENTITY_INSERT option to ON.
RESOLUTION
You can use the SET IDENTITY_INSERT statement to set the IDENTITY_INSERT option. SET IDENTITY_INSERT always references a table, and you should place it before the UPDATE or INSERT statement that modifies or inserts data into an IDENTITY column. The following example sets IDENTITY_INSERT for the NewEmployees table.
SET IDENTITY_INSERT NewEmployees ON
REFERENCES
For more information about IDENTITY INSERT, refer to SQL Server Books Online. To download the SQL Server Books Online, visit the following Microsoft Web site:
Modification Type: | Minor | Last Reviewed: | 8/10/2004 |
---|
Keywords: | KbClientServer kberrmsg kbprb KB294923 |
---|
|