question

liton avatar image
liton asked

Bulk insert comma delimited file

I have a file which is comma delimited. There are text fields and numeric fields. There are double quotes within the text fields and in the text fields there are also commas. When I try to load (bulk insert) I get field mismatch error. Is there a way I can avoid this error? I can load either by SSIS package or bulk insert. Thanks in advance for the help.
bulk-insertcomma-delimited
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
TimothyAWiseman avatar image
TimothyAWiseman answered
Most error messages from SQL Server describe the problem in a literal sense. Are you certain you don't have a misalignment so that you are failing to cover a field or trying to put a text value inside of a floating point field? If you double check that and everything is lined up properly, could you provide us the exact command you are using? A couple of rows of sample data and the table schema could also be helpful.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.