Error - existing connection was forcibly closed by the remote host

Padmanabhan, Venkatesh 246 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 | Other
{count} votes

2 answers

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

  2. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.