Link to home
Start Free TrialLog in
Avatar of gateguard
gateguard

asked on

BULK INSERT: table has IDENTITY column

This is a general question involving BULK INSERT and format files in the case of the table having an identity column.

table:  id, firstname, lastname, title

data file row:  firstname, lastname, title

How do you handle this situation using a format file?
ASKER CERTIFIED SOLUTION
Avatar of Sham Haque
Sham Haque
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess when you don't mention the Id in the format file it will be generated normaly on import
Avatar of gateguard
gateguard

ASKER

I'll tell you right now, in my opinion there is absolutely NOTHING straight-forward about anything to do with BULK INSERT.

I have tried inserting a data file with a single row with a single field into a table with a single column and I still get errors!

Do you happen to have a sample file (with a sample table description) that you know for a fact actually works with BULK INSERT?
let me ask you to put your full table creation, the format file, the file contents and the bulk insert statement you are trying to use.
the error you get looks like the data file does not match the format file.
I put a new sample table, data-row and error-message in the original question.

Sorry about posting follow-ups.  I thought it might be helpful to break this problem down into components.  I was wrong.
This question is still open.  My other problem, in another related question is fixed.

But I still don't know the answer to this question.

Does anybody?
I just used gbshahaq's method and it worked perfectly.  Thanks.
glad to help, gateguard.
sometimes you just have to go with the simpler options...