Network-related error 🗃️ SQL

SQL Server: A network-related or instance-specific error occurred while establishing a connection to SQL Server. (provider: Named Pipes Provider, error: 40 / TCP Provider, error: 26)

The client couldn’t reach the SQL Server instance — wrong server name/instance, TCP disabled, firewall, or SQL Browser not running.

Seen on: SQL

Meaning

Named instances (SERVER\SQLEXPRESS) rely on the SQL Server Browser service (UDP 1434) or an explicit port. TCP/IP is disabled by default on Express.

Common causes

  • Wrong server/instance name
  • TCP/IP protocol disabled in SQL Server Configuration Manager
  • Firewall blocking 1433/1434
  • SQL Server/Browser service stopped

⚡ Quick fix

  1. Enable TCP/IP and restart the service
  2. Open ports 1433 (and UDP 1434 for named instances)
  3. Use server,port explicitly (myhost,1433)
  4. Start SQL Server Browser

Detailed fix by platform

Windows

  1. Test-NetConnection sqlhost -Port 1433

How to diagnose

  1. Name — Correct server\instance?
  2. Network — Port reachable?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.