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?
table: id, firstname, lastname, title
data file row: firstname, lastname, title
How do you handle this situation using a format file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I guess when you don't mention the Id in the format file it will be generated normaly on import
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?
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.
the error you get looks like the data file does not match the format file.
I posted in your prior question:
https://www.experts-exchange.com/questions/22747077/Problems-with-BULK-INSERT-format-file.html
https://www.experts-exchange.com/questions/22747077/Problems-with-BULK-INSERT-format-file.html
ASKER
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.
Sorry about posting follow-ups. I thought it might be helpful to break this problem down into components. I was wrong.
ASKER
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?
But I still don't know the answer to this question.
Does anybody?
ASKER
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...
sometimes you just have to go with the simpler options...