简体   繁体   中英

How can I ignore bulk load data conversion error (truncation)

I have a file that is an extract from a MySQL table that I would like to in turn load to a SQL table (csv file) through a SSMS job. However, there is a field in the file that is defined as "LONGTEXT", which is way too long for a SQL table. I'd like to use BULK INSERT to load the file, but as expected, I'm getting an error "bulk load data conversion error (truncation)" on the "LONGTEXT" field. I don't mind truncating the field, so that I can get it loaded, but don't know how to ignore that specific error. Any ideas how to address this?

thanks so much in advance!

Given what you said there are two ways to fix the problem.

  • Make the column bigger in the table you are inserting the data

  • Make the data smaller in the CSV file.

If you can't do one of those two things then you can't use BULK INSERT without getting the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM