Persistent SQL Server Service Termination with Port Configuration Errors Despite Firewall and TCP/IP Adjustments and basic troubleshooting

Tharun Reddy K 20 Reputation points
2024-09-18T06:26:14.5033333+00:00

Hello, I am using an enterprise application on one of my servers (Server 2019) and recently migrated its database to MSSQL 2022 on another server. Initially, it was slow, but now SQL Server is repeatedly stopping right after starting.

Here’s what I’ve checked so far:

  • The SQL Server services are running under an Enterprise Admin account.
  • TCP/IP is enabled for the specified server IP.
  • Firewall is temporarily disabled for both the servers, so there should be no port issues.

Despite this, the error logs still indicate port-related problems and won’t let me move forward. Below is the error I’m encountering:

"Failed to retrieve data for the request - An exception occurred while executing a Transact-SQL statement or batch.

The connection is broken, and recovery is not possible. The client driver attempted to recover the connection multiple times, but all attempts failed. Increase the ConnectRetryCount value to increase the number of recovery attempts. (Microsoft SQL Server, Error: 0)


A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)"

I’ve tried restarting the services and checking configuration settings, but the problem persists. Would it be possible to have a remote support session to troubleshoot this issue further? Any guidance or next steps would be greatly appreciated.

Thank you!

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,689 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,956 questions
{count} votes

Accepted answer
  1. CathyJi-MSFT 21,871 Reputation points Microsoft Vendor
    2024-09-18T07:33:57.3666667+00:00

    Hi Tharun,

    Could you successfully connect to your SQL server instance using local SSMS?

    Please follow below steps to troubleshot SQL server connection issue,

    1. Make sure SQL Server Service is running, you can check this from SQL server configuration manager or windows service.
    2. If a named instance, make sure SQL Server browser service is running. Make sure the instance name is spelled correct and there is actually such an instance on your target machine.
    3. Make sure SQL Server is configured to allow remote connections if this is a remote connection.
    4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports.
    5. Test server connectivity with PING from the client machine.
    6. Test port connectivity using TELNET to the server and port (from step 4) from the client machine.  For example,

    TELNET <server-name> 1433

    1. Check firewall settings if step 5 or 6 connectivity test fails.

    If you have some confuse about the steps, please refer to MS document A network-related or instance-specific error occurred while establishing a connection to SQL Server to get more information.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.