Error - existing connection was forcibly closed by the remote host

Padmanabhan, Venkatesh 241 Reputation points
2021-09-21T05:57:57.707+00:00

Hi. I am using a console .NET application which uses the SQL BCP queryout method to retrieve data from table and store in a delimited file. If the select query is taing a longer time, then i have observed this timeout. Are there any parameters which need to be added in BCP syntax to avoid this issue ?

Some times I am getting the below error : SQLState = 08001, NativeError = 10054
Error = [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: An existing connection was forcibly closed by the remote host.

SQLState = 08001, NativeError = 10054
Error = [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection

How to fix this ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,102 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 42,561 Reputation points
    2021-09-21T06:19:55.883+00:00

  2. CathyJi-MSFT 21,111 Reputation points Microsoft Vendor
    2021-09-21T07:03:26.463+00:00

    Hi @Padmanabhan, Venkatesh ,

    What are the windows versions on both servers? Suggest you reading the MS document that Olaf mentioned. Please check if your environment is one situation of that.

    By the way, please check if this blog could help you. Suggest you to try the suggestions in test environment.

    > If it is an encryption issue, won't all the queries fail ?

    No, you may get an error at random times.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.

    0 comments No comments