An error occurred in Excel importing data into SQL Server: "The text is truncated, or one or more characters do not match in the target code page"

Source: Internet
Author: User
Tags truncated

When importing data from Excel to SQL Server, there is an error in importing due to the Long data in the table (if the data is not very long, within 255, no error occurs):

Cause of Error:

Import and export of SQL Server to determine the data table for each field type, take the first few rows of each field in the Excel table (3 rows) to distinguish. If the first 3 is a string of less than 255, it is set to the nvarchar (255) type, so if the number of characters in the fourth or later data is greater than 255, an error will be made.

Workaround:

Before importing data, you can manually add a few unrelated data, so that the number of characters in the field is greater than 255, and SQL Server will be imported with the type set to nvarchar (max) without error. After successful import, delete irrelevant data.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.