Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bulk copy into table with existing data

Status
Not open for further replies.

Katy44

Technical User
Dec 12, 2003
723
GB
I have a table with some existing data in it. It has an identity column - since I wanted to keep the ID the same as the PK in the table it was migrated from, I inserted into that by allowing identity insert.
I now have a bulk copy that is inserting data into this table. It works fine when I point it to an identical table which is empty, but fails when I try to make it insert into the actual table.
I have set the identity seed to be the max+1 of existing records, so I really can't see why it would fail. Any help would be appreciated. Also, if anyone could help me with how to figure out why my bcp is going wrong in more general terms - the errors file I set up is empty.
 
Ignore this - it was actually nothing to do with the identitiy column.
The problem was with a field that was a smalldatetime and should have been a varchar (as it was in the test table).
The error file was fine once I deleted it and let it run again - if your bcp is not working and you don't know why I would recommend trying this.
The bcp is working fine now, and my identity value is incrementing as you would expect
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top