When sqlbulkcopy imports data: A transmission-level error occurs when receiving results from the server. (Provider: TCP provider, error: 0-the specified network name is no longer available)

Source: Internet
Author: User

Source: http://www.lmwlove.com/ac/ID473

I made a small tool and used sqlbulkcopy to import data to the database in batches. I used it well before. When I was using it today, I reported a transmission-level error when receiving results from the server. (Provider: Provided By TCPProgram, Error: 0-the specified network name is no longer available.) I thought it was a problem with the server. I checked it and confirmed that there was no problem with the server. I thought it was a column ing error. Check and debug carefully. There is still no problem. Crazy ......

Honestly from the data source check, suddenly found that the length of a column in a row of data in the data source exceeds the length of the database field, is this the problem? I changed the field length to a higher value. The test passed and finally found the cause ......

Conclusion: when using sqlbulkcopy to import data, if the data length of the data source exceeds the length of the database field, the sqlserver service is disabled, leading to a transmission-level error when receiving results from the server. (Provider: TCP provider, error: 0-the specified network name is no longer available) error.

However, I have never figured out that an error that exceeds the field length should be returned if it exceeds the field length. Why is it so serious to close the sqlserver service?

 

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.