BUG: BCP Into a Table w/ IDENTITY Column Cannot Be Performed

ID: Q136533


The information in this article applies to:
  • Microsoft SQL Server versions 6.0, 6.5

BUG #: 10361 (6.00)

SYMPTOMS

A bulk copy into a table with an IDENTITY column cannot be performed when a value for the IDENTITY column has not been specified in the data file.


WORKAROUND

To work around this problem, do one of the following:

  • Make sure a value is present for the IDENTITY column in the data file. If the values present in the data file are the actual values to be inserted in the table, use the /E option. If SQL Server-generated values need to be used, run the bulk copy program (BCP) without the /E option.




-or-

  • Perform the following steps:

  • Create a temporary table without an IDENTITY column.


  • Bulk copy the data into the table created in step 1.


  • Use INSERT INTO or SELECT INTO to insert the data into the original table from the temporary table.





STATUS

Microsoft has confirmed this to be a problem in SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

BCP IN into a table will work if any value is specified for the IDENTITY column. You can use the /E option when identity values are present within the table to be imported. Without the /E option, the SQL Server will generate identity values for the rows.

Additional query words: sql6 import temp tbl insert/select

Keywords : kbtool SSrvBCP kbbug6.50 kbbug6.00
Version : WINNT:6.0 6.5
Platform : winnt
Issue type : kbbug


Last Reviewed: April 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.