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

Last reviewed: January 22, 1998
Article ID: Q136533

The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 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:

    1. Create a temporary table without an IDENTITY column.

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

    3. 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 : kbbug6.00 kbbug6.50 SSrvBCP kbtool
Version : WINNT:6.0 6.5
Platform : winnt
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 22, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.