Issue to access

Jonathan 300 Reputation points
2026-07-06T01:55:38.21+00:00

Hi,

Can you help to this?

TITLE: Error


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)

For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

SQL Server Database Engine
0 comments No comments

4 answers

Sort by: Most helpful
  1. Erland Sommarskog 135.5K Reputation points MVP Volunteer Moderator
    2026-07-06T09:47:16.26+00:00

    The error message means that you were not able to reach the SQL Server instance you specified. There can be any number of reasons for this:

    • SQL Server is not running.
    • You mispelled the server and/or instance name.
    • SQL Server is not installed at all.
    • There are firewalls blocking the access.
    • You are connecting to a named instance on a remote computer and the browser service is not running.

    This list is not exhaustive. Without further details on why you expect connection to succeed or what troubleshooting you have conducted, we can only answer in general terms. But I should add that the screenshot you showed above is not relevant. You are not coming that far that this setting matters.

    Here is a link to a troubleshooting article: https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-the-sql-server-database-engine

    Was this answer helpful?

    0 comments No comments

  2. Senthil kumar 1,465 Reputation points
    2026-07-06T05:09:10.0466667+00:00

    Hi @Jonathan

    • First Check your port and firewall blocking from the SQL server installed system and connecting system.
    • try to connect SQL server with with server name . your server name server1 then server1\SQLEXPRESS.
    • then check any services stopped in press windows + R type services.msc search sql server services stopped or running.

    Thanks.

    Was this answer helpful?

    0 comments No comments

  3. Deepesh Dhake 405 Reputation points
    2026-07-06T04:07:43.44+00:00

    The key detail is Named Pipes Provider and Error: 2. That "2" is the Win32 code for "file not found" - the client tried to open a named pipe endpoint that doesn't exist.

    You can run these in order:

    1. Confirm the service is actually up. Elevated PowerShell: Get-Service MSSQL*. For Express the service is MSSQL$SQLEXPRESS. If it's stopped or stuck in Starting, that's your answer. Open the ERRORLOG at \MSSQL16.SQLEXPRESS\MSSQL\Log\ERRORLOG and read the tail of the last start attempt that tells you why it didn't come up. Cross-reference the System event log around boot time.
    2. If it's up, verify you're targeting the right pipe. Express is a named instance: connect as .\SQLEXPRESS, localhost\SQLEXPRESS, or MACHINE\SQLEXPRESS. Confirm the real instance name in Configuration Manager.
    3. If the name is right and it's still failing, check that Named Pipes is enabled for that instance: Configuration Manager then Protocols for SQLEXPRESS then Named Pipes. If it's disabled, a client explicitly requesting the NP provider gets exactly this. Toggling it needs a service restart.
    4. Only if remote: then Browser (UDP 1434) and the instance's TCP port in the firewall come back into play.

    Was this answer helpful?


  4. AI answer

    2026-07-06T01:56:25.7866667+00:00

    The error indicates that the client cannot reach the SQL Server instance specified in the connection (Named Pipes Provider, error: 40). This is a connectivity/configuration problem, not specific to Analysis Services.

    Use these steps to troubleshoot:

    1. Confirm SQL Server is installed and running
      On the machine where the instance should be:
      • Open SQL Server Configuration Manager and verify the Database Engine service is present and in the Running state.
      • If SQL Server is not installed or the service is stopped, start it or install SQL Server as needed.
    2. Verify server and instance name
      Connection failures commonly occur due to incorrect names:
      • If it is a default instance, connect using just the computer name (for example: ACCNT27).
      • If it is a named instance (for example Express), connect using COMPUTERNAME\SQLEXPRESS.
      • Make sure the server name in the connection string or SSMS connection dialog matches the actual instance name. See the guidance under Verify the server name in the connection string.
    3. Test a local connection first
      On the SQL Server machine:
      • Start SQL Server Management Studio.
      • In the Connect dialog, choose Database Engine, Windows Authentication, and enter the server name as above.
      • If this local connection fails, resolve that issue first (permissions, missing default database, or service not running) before troubleshooting remote access.
    4. Check client network protocols (Named Pipes vs TCP/IP)
      Because the error mentions Named Pipes Provider:
      • On the client, open SQL Server Configuration Manager.
      • Under SQL Native Client <version> Configuration → Client Protocols, ensure TCP/IP is enabled and ordered before Named Pipes.
      • Try connecting again using the computer name, first forcing TCP/IP (for example via a TCP-only alias) and then without forcing TCP. If forcing TCP works but the default fails, the client is trying Named Pipes first.
    5. Verify aliases on the client
      If using aliases:
      • Open SQL Server Configuration Manager → SQL Native Client Configuration → Aliases.
      • Check that the alias points to the correct server name/IP and port, and that any Named Pipes alias uses the correct pipe format (for example \\Mydefaultinstance\pipe\sql\query for a default instance).
    6. Check firewall configuration
      If connecting remotely:
      • Ensure firewalls allow traffic to the SQL Server port (default TCP 1433 or the configured port for the instance).
      • For named instances, confirm that UDP port 1434 is not blocked or specify the port explicitly in the connection string as <servername\instancename>,<portnumber>.
    7. Check Windows login permissions for Named Pipes
      If using Named Pipes and the error persists:
      • Ensure the Windows account used on the client is a member of the Users group on the SQL Server machine. Lack of permission to log in to Windows can cause Named Pipes connection failures.

    If this is on a private laptop and only SQL Server Management Studio was installed, install SQL Server itself; SSMS alone cannot host a SQL Server instance.


    References:

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

    Was this answer 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.