BCP Load with Identiy Column
Posted on 2011-10-13
I have a BCP Question.
I have define a new (empty) "Organization" table :
- OrdId int Identity)
- OrgName varchar 2000
- OrgDesc varchar 2000
Now I have a tab delimited file with just the OrgName and OrgDesc columns pulled from an EXCEL spreadsheet to load the table.
I use the following BCP command:
bcp myDB.dbo.Organization in "Organizations.txt" -T -c -m 1 -e error.txt
The identity column gets generated but the columns get all misallligned. Do I have to leave an empty tab column for the identity column?
To work around this, I take out the identity column, load the table and add it back into the table.
Please advise how to initially load a table with data when an identity column is defined.
Thanks in advance,