What is timedc for in TCP IP

Troubleshoot connection problems with the SQL Server database engine

Scope of application:SQL Server (all supported versions)

This article provides troubleshooting procedures when you cannot connect to an instance of the SQL Server database engine on a single server.

Note

For other scenarios see:

It does not start with the most common problems that you have probably already checked for. These steps are in order from the most basic problems to the more complex. This assumes that you are connecting to the SQL Server instance from another computer using the TCP / IP protocol (the most common situation).

These instructions are for troubleshooting the error "Connect to the serverThe following example illustrates an error message:

This error usually means that the client cannot find the SQL Server instance. This usually happens when you have had one or more of the following problems:

  • Name of the computer hosting the SQL Server
  • The instance does not resolve the correct IP address
  • The TCP port number is not specified correctly

Not included

Get the instance name from Configuration Manager

Check the instance name on the server hosting the SQL Server instance. Use the SQL Server Configuration Manager.

Configuration Manager is automatically installed on the computer if SQL Server is installed. Instructions for starting Configuration Manager vary slightly depending on the version of SQL Server and Windows.) For version-specific details, see SQL Server Configuration Manager.)

  1. Log in to the computer hosting the SQL Server instance.

  2. Start the SQL Server Configuration Manager.

  3. Select in the left pane SQL Server services out.

  4. In the right pane, check the name of the database engine instance.

    • refers to a standard instance of SQL Server. The name of the default instance is.
    • refers to a named instance of SQL Server. The name of the named instance is.

Verify that the instance is running

To verify that the instance is running, look at the icon next to the SQL Server instance in the SQL Server Configuration Manager.

  • A green arrow indicates that an instance is running.
  • A red square indicates that an instance is paused.

If the instance is stopped, right-click the instance, and then click Start. The server instance starts and the indicator turns into a green arrow.

Verify - running SQL Server browser

The SQL Server Browser Service must be running to connect to a named instance. Check in the configuration manager that the service SQL Server browser is performed. If it's not running, start it. The SQL Server browser service is not required for standard instances.

A standard instance of SQL Server does not require a SQL Server browser service.

Testing a local connection

Before troubleshooting a connection problem from another computer, first verify that you can connect from a client application that is locally installed on the computer that is running SQL Server. Establishing a local connection avoids problems with networks and firewalls.

This procedure uses SQL Server Management Studio. If you don't have Management Studio installed, go to the SQL Server Management Studio (SSMS) Download Center. If you cannot install Management Studio, you can use the utility to verify the connection. is installed using the database engine. For more information, see sqlcmd (utility).)

  1. Log on to the computer on which SQL Server is installed using a login that has permission to access SQL Server. (During installation, SQL Server requires at least one login that is specified as a SQL Server administrator. If you do not know an administrator, see Connecting to SQL Server When System Administrators Are Locked Out for more information.)

  2. On the Home screen, or on older versions of Windows, tap the Start menu SQL Server Management Studio a, point on All programs and then on Microsoft SQL Server, and then click SQL Server Management Studio.

  3. In the dialog box, choose Connect to the server , in The Field server the option Database engine out. Select in the field Authentication the option Windows authentication. Enter in the field Server name one of the following connection types:

    Connect totypeexample
    Default instance
    Named Instance

    Note

    When connecting to a SQL Server from a client application on the same computer, the shared memory protocol is used. Shared memory is a type of local named pipe. However, errors sometimes occur with the pipes.

    If you get an error message at this point, you will need to resolve the error before proceeding. Lots of things could be a problem. Your login name may not be authorized to connect. Your default database may not exist.

    Note

    Some error messages that are intentionally passed to the client do not provide enough information on how to correct the problem. This is a security feature designed to prevent information from being passed through SQL Server to an attacker. Review the SQL Server error log for all information about the error. There you will find the details.

  4. If you are getting the error, see the MSSQLSERVER_18456 topic in the online documentation for more information on error codes. You can also find an extensive list of error codes on Aaron Bertrand's blog at Troubleshooting Error 18456. You can view the error log using SSMS (if you can connect) in the Administration section of Object Explorer. Otherwise, you can view the error log using Notepad. The default location varies by version and can be changed during setup. The default location for SQL Server 2019 (15.x) is.

  5. If you cannot connect using shared memory, try connecting using TCP. You can force a TCP connection by entering in front of the name. Example:

    Connect to:Type:Example:
    Default instance
    Named Instance
  6. If you can connect using shared memory but not TCP, then you need to fix the TCP problem. Most likely, TCP is not enabled. Follow the steps above to enable protocols to enable TCP.

  7. If you want to connect with an account other than the administrator account, try connecting again. You can do this using the Windows authentication login or the SQL Server authentication login used by the client application.

Get the IP address of the server

Get the IP address of the computer hosting the instance of SQL Server.

  1. Click in the start menu To run. Enter in the window To runcmd and then click OK.
  2. In the Command Prompt window, type and press ENTER. Make a note of that IPv4 Address and the IPv6 Address.

SQL Server can connect using either version 4 or version 6 IP protocols. Your network may allow one or both of these options. Most of the users start by looking at the problems of the IPv4 -Handle address. This is shorter and easier to enter

Get the TCP port of the SQL Server instance

In most cases, you will be connecting to the database engine from another computer using the TCP protocol.

  1. Use SQL Server Management Studio on the computer running SQL Server and connect to SQL Server. In Object Explorer, expand management and SQL Server logsand double-click the current log.
  2. In the Log Viewer, click the button on the toolbar filter . Enter in the field Message contains text a, click Apply filter and then on OK.
  3. A message such as should be listed.

This message indicates that this instance of SQL Server is listening on all IP addresses on this computer (for IP version 4) and on TCP port 1433. (TCP port 1433 is usually the port used by the Database engine or a standard instance of SQL Server is used. Only one instance of SQL Server can use a port, so if multiple instances of SQL Server are installed, some instances must use different port numbers.) The port number used by the instance that you want to connect to.

Note

Probably will be listed. This address is known as the "loopback adapter address". Only processes that are on the same computer can connect to it. It can be useful for troubleshooting, but you cannot use this address to connect from another computer.

Enable protocols

In some installations of SQL Server, the connection to the database engine from another computer is not enabled unless an administrator uses Configuration Manager to enable the connection. To enable connections from another computer:

  1. Open the SQL Server Configuration Manager as previously described.
  2. In the left pane of the Configuration Manager, expand SQL Server network configuration, and then select the SQL Server instance that you want to connect to. The right area lists the available connection protocols. Shared memory is usually activated. It can only be used on the same computer, so most installations have shared memory enabled. You typically use TCP / IP to connect to SQL Server from another computer. If TCP / IP is not enabled, right-click on TCP / IP and then on Activate.
  3. If you have changed the activation setting for a protocol, restart the database engine. Select in the left pane SQL Server services out. In the right pane, right-click the database engine instance, and then click Start anew.

Test the TCP / IP connectivity

Connecting to SQL Server over TCP / IP requires Windows to be able to connect. Use the tool to test TCP.

  1. Click in the start menu To run. Enter in the window To runcmd and then click OK.

  2. In the Command Prompt window, type, then type the IP address of the computer running SQL Server. Example:

    • IPv4:
    • IPv6:
  3. If your network is configured correctly, B. will return followed by some additional information. If or returns, TCP / IP is not configured correctly. Errors at this point could indicate a problem with the client computer or the server computer, or that something is wrong with the network, such as the router. For information about troubleshooting network problems, see Advanced troubleshooting for TCP / IP problems.

  4. If the ping test using the IP address was successful, verify that the computer name resolves to a TCP / IP address. In the Command Prompt window on the client computer, type, then type the computer name that is running SQL Server. Example:.

  5. If that succeeds to the IP address but or returns to the computer, you may have old (outdated) name resolution information cached on the client computer. Type in to clear the Dynamic Name Resolution (DNS) cache. Then ping the computer again by name. The client computer uses the flushed DNS cache to find the latest information about the IP address for the server computer.

  6. If your network is configured correctly, B. will return followed by some additional information. If you can successfully ping the server computer at the IP address but get an error such as or when pinging the computer name, then the name resolution is not configured correctly. (For more information, see the 2006 article mentioned earlier, Chapter 16 - Troubleshooting TCP / IP.) Successful name resolution is not required to connect to SQL Server. However, if the computer name cannot be resolved into an IP address, the connections must be made by specifying the IP address. The name resolution can be corrected later.

Open a port in the firewall

Windows Firewall is enabled by default and blocks connections from another computer. You must configure the firewall on the SQL Server computer to allow connections to the TCP port that the database engine uses to connect using TCP / IP from another computer. The default instance listens on TCP port 1433 by default. If you have named instances or have changed the port of the default instance, the SQL Server TCP port might be listening on a different port. See Getting the TCP Port of the SQL Server Instance.

If you are connecting to a named instance or a port other than TCP port 1433, you must also open UDP port 1434 for the SQL Server browser service. For step-by-step instructions on how to open a port in Windows Firewall, see Configure a Windows Firewall for Database Engine Access.

Testing the connection

If you can connect using TCP on the same computer, then it's time to connect from the client computer. In theory, you can use any client application you want. However, to avoid additional complexity, install the SQL Server Management Tools on the client and try it with SQL Server Management Studio.

  1. On the client computer using SQL Server Management Studio, try to connect using the IP address and TCP port number in the format IP address, comma (,), port number. Example:. If this connection fails, you are likely having one of the following problems:

  2. Once you can connect using the IP address and port number, try to connect using the IP address without a port number. For a standard instance you only need to use the IP address. For a named instance, use the IP address and the instance name in the format "IP address backslash () instance name", for example. If that doesn't work, you are likely having one of the following problems:

    • When you connect to the default instance, it may be listening on a port other than TCP port 1433 and the client will not try to connect to the correct port number.
    • When you connect to a named instance, the port number is not returned to the client.

    Both problems relate to the SQL Server browser service that provides the port number to the client. The solutions are:

    • Start the SQL browser service. See the instructions for starting the browser in SQL Server Configuration Manager.
    • The firewall is blocking the SQL Server browser service. Open UDP port 1434 in the firewall. Navigate back to the Opening a port in the firewall section. Make sure that you are not opening a TCP port, but a UDP port.
    • The information on UDP port 1434 is blocked by a router. User Datagram Protocol (UDP) communication is not designed to traverse routers. This prevents the network from being filled with low priority traffic. You can configure your router to forward UDP traffic or you can always specify the port number when you connect.
    • If the client computer is running Windows 7 or Windows Server 2008 (or a later operating system), UDP traffic may be dropped from the client operating system because the response from the server is being returned from a different IP address than the one queried from. This is a safety feature that blocks “loose source mapping”. See the section for more information Multiple server IP addresses online documentation Troubleshooting: The timeout has expired. This is an article from SQL Server 2008 R2, but the principals are still valid. You can configure the client to use the correct IP address, or you can always provide the port number when you connect.
  3. After connecting using the IP address (or using the IP address and instance name for a named instance), try connecting using the computer name (or a computer name and instance name for a named instance). Add before the computer name to force a TCP / IP connection. Use for the default instance on a computer named. Use for a named instance named on this computer. If you can connect by IP address but not computer name, you have a problem with the computer name resolution. Navigate back to Section 4 entitled Test the TCP / IP connectivity.

  4. After connecting by computer name and forcing TCP, try connecting by computer name and not forcing TCP. For example, use only the computer name for a standard instance, such as. For a named instance, use the computer name and instance name, e.g.. If you can connect while forcing the TCP, but not without forcing the TCP, the client may be using a different protocol (such as named pipes).

    1. Using SQL Server Configuration Manager on the client computer, expand in the left pane SQL Native Clientversionconfiguration, and then click Client Protocols (Client logs).
    2. Check whether TCP / IP is activated in the right pane. If TCP / IP is not enabled, right-click on TCP / IP and then on Activate.
    3. TC / IP must come before "Named Pipes" (or "VIA" for older versions) in the order of the protocols. In general, you should leave shared memory as order 1 and TCP / IP as order 2. Shared memory is only used when the client and SQL Server are running on the same computer. All activated protocols are tested in this order until a connection can be established. However, if the connection is not made to the same computer, shared memory will be skipped.

Is this page helpful?