Share via

Logon issue

Jonathan 85 Reputation points
2026-06-04T09:33:24.9333333+00:00

Hi,

Can you help to this?

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)

SQL Server Database Engine
0 comments No comments

Answer accepted by question author

AI answer

2026-06-04T09:33:58.06+00:00

The error indicates that the client cannot reach the specified SQL Server instance over Named Pipes/TCP. Common causes are wrong server/instance name, SQL Server not running, or network/firewall/protocol configuration issues.

Use these steps to troubleshoot and fix it:

  1. Verify the SQL Server instance name
    • On the SQL Server machine, open SQL Server Configuration Manager.
    • Go to SQL Server Services and check the service name:
      • SQL SERVER (MSSQLSERVER) = default instance → connect using just the computer name.
      • SQL SERVER (<instance name>) = named instance → connect using <ComputerName>\<InstanceName>.
    • Make sure the instance name in the connection (SSMS, app connection string, Power BI, etc.) matches exactly.
  2. Confirm SQL Server is installed and running
    • In SQL Server Configuration Manager, ensure the SQL Server service for that instance is Running.
    • If it is stopped, start it and then retry the connection.
    • If only SQL Server Management Studio (SSMS) was installed but no SQL Server engine, install SQL Server; SSMS alone cannot host databases.
  3. Check network reachability and server name
    • If connecting remotely, verify the computer name or IP address is correct.
    • From the client machine, test basic connectivity (for example, ping the server or otherwise verify the machine is reachable).
    • If this is a local instance, use . or localhost or the local machine name instead of an IP if appropriate.
  4. Ensure TCP/IP (and protocol order) is configured correctly
    • On the client machine, open SQL Server Configuration Manager.
    • Under SQL Native Client <version> ConfigurationClient Protocols:
      • Ensure TCP/IP is Enabled.
      • Ensure TCP/IP has a lower protocol order number than Named Pipes so it is tried before Named Pipes for remote connections.
  5. Verify SQL Server is configured for remote connections
    • On the server, ensure the instance is configured to allow remote connections.
    • If remote connections are disabled, enable them and restart the SQL Server service.
  6. Check firewalls and ports (for remote connections)
    • Ensure that the SQL Server port (default TCP 1433 for a default instance, or the configured port for a named instance) is open on:
      • The Windows firewall on the SQL Server machine.
      • Any network firewalls between client and server.
    • If the port is blocked, open it for inbound connections to allow clients to connect.
  7. If using Named Pipes, verify Windows logon permissions
    • If connections are using Named Pipes and consistently failing, ensure the user account has permission to log in to Windows on the SQL Server machine.
    • Add the user to the Users group on the SQL Server machine (and all nodes if mirrored/clustered) if necessary.

If the problem persists after these checks, collect more details as suggested (instance name, IP, TCP port, protocol configuration, firewall status) and then continue troubleshooting using the SQL connectivity guidance.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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