Excel import SQL Server string is intercepted as a 255-length solution

Source: Internet
Author: User
Tags first row truncated

An Excel table imports a string that is truncated to a length of 255 in the SQL Server data table.

Note: Excel uses the data type of the first 8 rows (except for the first row of the header) to determine the data format of the imported data, for example, the first 8 lines are integer, then the data is imported by default in the form of integer data read, and for example, the first 8 rows are string types that are less than 255 in length. The default is that the entire column is less than 255, so that strings that are longer than 255 are truncated when imported.

Other solutions on the web I won't mention it, and I'll show you how.

Easy-to-use solution:

1. Insert 8 rows of empty data in the Excel table you will import.

2. In the 8 row just entered, enter a string greater than 255 length in the cell of the truncated column.

3. The import function of SQL Server will find that the previously resolved columns will not be intercepted at this time.

Excel import SQL Server string is intercepted as a 255-length solution

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.