Состояние sql s0012 код ошибки 26

Hi
  • Remove From My Forums
  • Question

  •  Hi

    Could you please help me to resolve the issue the error :26  while establishing connection with SQL server-2012 ( Express edition) in my local machine. I have installed and configure SQL Server -2012 (Express edition). I have thoroughly checked and
    configured TCP/IP to make Enable and insert IP address and port No. 1433 and accordingly set-up new roles  in Firewall for both TCP/IP, programme option to recognize to access SQL server/programme to Firewall.

    I have also configured SQL management studio  Security option i.e New Logins> General > Server Roles> User mapping> as attached screen shoot with this mail.

    I have also made enable (Yes) on ICPM through Firewall properties as using  windows -8(standard version), but still SQL server isn’t enable to connect. I hereby enclosed the error screen shoot. I am testing it ACT ( application compatibility toolkit)
    prior configuring this server to SharePoint-2013 or 2010 farm server.

    You co-operation in this regard be appreciated.

    Regard

    AzadSQL Studio log in propertise ACT


    Azadur Sarker 6, Seaford street Stoke-on-Trent, ST4 2EU

Answers

  • The SQL Server client asks the SQL Server Browser service what port the SQL Server is listening on. This uses UDP port 1434. Try opening that port in the firewall, or skip the instance name to port number resolution stage by specifying the port number, connecting
    to AZAD-PC,1433

    More troubleshooting in the MSDN SQL Server wiki at
    How to Troubleshoot Connecting to the SQL Server Database Engine


    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

    • Marked as answer by

      Wednesday, December 12, 2012 12:30 PM

  • You are probably not running the Express edition. Your screenshot of the SQL Server Configuration Manager (with the green border above) shows that you have installed an instance of the SQL Server Database Engine called MSSQLSERVER. (That’s the one listed
    as «SQL Server (MSSQLSERVER)«. Normally when you install SQL Server Express, you would see it listed as «SQL Server (SQLEXPRESS)«. (It is possible to install express and name it MSSQLSERVER but that is an advanced option that
    you must script and it’s unlikely you did that.) However it got installed, when the instance is named MSSQLSERVER it is know as a default instance. (You are only allowed one default instance, though you can install many named instances.)

    To connect to a default instance, you provide the computer name, not the computer name + instance name. So… change your connection to use
    AZAD-PC and do not use AZAD-PCSQLEXPRESS.

    If you think you should have both a default instance and an instance of SQL Server Express, then I think the Express installation failed, and you have to do it again.

    Sorry you are having trouble.


    Rick Byham, Microsoft, SQL Server Books Online, Implies no warranty

    • Marked as answer by
      Sarker Azad
      Thursday, December 13, 2012 4:32 PM

Methods to Resolve SQL Server Error 26

Users often see “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified” error message while connecting to SQL Server.

SQL Server Error 26

SQL Server Error 26 occurs when users trying to connect to a SQL Server named instance. The reason of the SQL Server Error 26 is the client stack could not receive SSRP response UPD packet from SQL Browser.

Tip: Fix SQL Server Management Studio Error 40

You have to create an incoming rule that allows traffic from all promising IP addresses that are configured for the failover cluster instance and from all possible IP addresses of the remote server. For this you have to follow the below steps

    • Open Adminstrative Tools, from Control Panel
    • In Adminstrative Tools, click on Windows Firewall with Advanced Security
    • Under Windows Firewall with Advanced Security on Local Computer column, click on the Inbound Rule and then select New Rule from the right pane

Windows Firewall with Advanced Security

    • From New Inbound Rule Wizard window, select Custom and then click on the Next button

Select Custom

    • Under Does this rule apply to all programs or a specific program? select All programs then click on Next button

Select All Program

    • Form Protocol type list, select Any and then click on Next button

Select Protocol Type

    • Under Which remote OP addresses does this rule apply to? select These IP addresses and then click on Add button

Select These IP Addresses

    • In IP Address dialog box, under This IP address or subnet type the IP address and then click on Ok button

IP Address

    • Under What action should be taken when a connection matches the specified conditions? select Allow the connection and then click on Next button

Allow the connection

  • Click on the Next button to complete the New Outbound Rule Wizard steps

Other Possible Causes of SQL Server Error 26 with Solution

SQL Server does not allow remote connections

  • To resolve the SQL Server Error 26 open SQL Server Management Studio, Right click on the database and select properties
  • On Security page, select SQL Server and Windows Authentication mode and click on Ok button
  • Restart SQL Server

If you are still facing the SQL Server Error 26, then there could be a same name conflict between two systems. Check whether the computer name, system name is same if yes, then try to system using its IP address.

Sometimes you may see “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified” error message when connecting to a SQL Server and don’t know where to start. In most forums people say this is because remote connection is not enabled on the server. This is not exactly correct. Actually, this error message gives customers a very specific information and the solution is quite simple.

First of all, you get this error message only if you are trying to connect to a SQL Server named instance. For a default instance you never see this. Why? Because even if we have failed at this stage (i.e. error locating server/instance specified), we will continue to try connect using default values, e.g default TCP port 1433, default pipe name for Named Pipes. You may see others error messages due to failure later, but not this error message.
Every time client makes a connection to SQL Server named instance, we will send a SSRP UDP packet to the server machine UDP port 1434. We need this step to know configuration information of the SQL instance, e.g., protocols enabled, TCP port, pipe name etc. Without this information,  a client does know how to connect to the server and it fails with this specific error message.
In other wors, the reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It’s easy to resolve the issue. Here are the steps:

  • Make sure your server name is correct, e.g., no typo on the name.
  • Make sure your instance name is correct and there is actually such an instance on your target machine. (Try to use a connection string like .<instance-name> to connect to an instance on your local computer. E.g:  .SQLEXPRESS)
  • When you try to connect to an SQL Server instance on another server,  make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
  • Make sure SQL Browser service is running on the server.
  • If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.

Once you are done with these steps, you should not see this error message anymore.

SQL Server Error 26 and SQL Server Error 40 appear when you try to connect to SQL Server. We will troubleshoot and try to fix them in the same article as both are related to connection issue. We recommend to use the below solutions for the both errors and to try to localize the problem.

The error Messages:

(provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

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: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

“ Named Pipes Provider Error: 40 – Could not open a connection to SQL Server“.

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)

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 the SQL Server is configured to allow remote connections. (provided: Named Pipes Provider, error: 40- Could not open a connection to the SQL Server) (Microsoft SQL Server, Error: 2).

sql server error 26

sql server error 26

SQL Server Error 26 and SQL Server Error 40

What is SQL Server Error 26?

You will get this error message while trying to connect to a SQL Server named instance and not when you use default instance. The client stack could not receive SSRP response UDP packet from SQL Browser.

How to fix Error 26 on SQL Server?

  1. Recheck the server name for any error and fix it
  2. Check the instance name for any error
  3. Check if SQL Server browser is running
  4. Control if this instance exist on server
  5. Ping the server and check if DNS can be resolved correctly

What is SQL Server Error 40?

This error appears mostly when SQL Server does not allow remote connections, Firewall Settings or TCP/IP is not enabled. We will explain below all those in order to troubleshoot easy.

Read also other SQL Server Helping Posts:

  1. How to fix SQL Server Error 229
  2. Fix SQL Server Error 233
  3. SQL Server Error 17002

How to fix error 40 on SQL Server?

  1. Check SQL Server is running
  2. Make sure that Allow Remote Connections is enabled on sql server properties
  3. Check if TCP/IP is enabled
  4. Configure to allow SQL Server in Firewall Settings
  5. Check for working fine SQL Server Browser
  6. Make sure that you can ping the SQL Server

Below we will explain the above steps in long way for better understanding and easy fix of SQL error 26 and sql error 40.

1. Check if SQL Services are running

Hint! If you are running SQL Server by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections.

How to check if SQL Server Service is running?

  • Go to SQL Server Configuration Manager > SQL Server Services
  • Find the service SQL Server (MSSQLSERVER) if default or the name of your instance
  • Check if is running – should be running state with a green indication

Using Windows Command Prompt

sc query mssqlserver

For named instance name use below by by replacing instancename with the actual SQL Server instance name.

sc query mssql$instancename

How to check if SQL Server Browser is running?

  • Navigate to SQL Server Configuration Manager > SQL Server Services
  • Find the SQL Server Browser Service
  • Check if it is configured to start automatically and is started – should be with a green indication

Using Windows Command Prompt

sc query sqlbrowser

Check if SQL Server Service

Check if SQL Server Service

2. Try to Flush DNS

How to flush DNS?

  1. Click Start Button
  2. Type CMD and press enter
  3. Type this into the black window that appears: ipconfig /flushdns and press enter.

Fluish DNS

Fluish DNS

3. Make sure that allow Remote Connection is enabled

Check if remote connections is allowed for applications/client. This option need to be allowed to establish connections and perform operations on the server. Often this is the reason of SQL Server Error 26 and SQL Server Error 40.

How to check if the remote connection is enabled?

  1. Open ‘SQL Server Management Studio’
  2. Right click on database name and select ‘Properties’
  3. In ‘Properties’ window, select ‘Security’, enable `SQL Server and Windows Authentication mode` and click `OK`.
  4. Now restart the SQL server.

Allow Remote Connections

Allow Remote Connections

4. Check Firewall

Check the firewall status for any troubles:

  1. Open ‘Control Panel’ and after that ‘Windows Firewall’.
  2. Select ‘Change Settings’ In ‘Windows Firewall’,
  3. Add an exception for port ‘1434’ and name it ‘SQL Server’
  4. Enable by clicking on the checkbox

5. Connection String

This solution is on cases when you are using connection string and are you writing it wrongly. For example connection string used by .NET framework:

Server=serverAddress;Database=dbName;User Id=username;

Password=password;

  1. Check for each parameter passed in the connection string for any typographical errors.
  2. Control the validity of the username/password.
  3. Confirm if the given database exists.

6. TCPIP Protocol

This solutions can work when you have mix of default and named instance or named instances only.

How to Enable TCP/IP port?

  1. Open SQL Server Configuration Manager
  2. Click on SQL Server Network Configuration and click on Protocols for Name
  3. Right-click on TCP/IP
  4. Click Enable
  5. Restart your SQL Server instance

Enable TCP-Ip port

Enable TCP-Ip port

If you want to use a static port for your instance (instead of dynamic that changes after every restart) you can change it here.

  1. Open Properties for TCP/IP protocol
  2. Go to IP Addresses tab
  3. Scroll down to IPAll section
  4. Remove 0 value from TCP Dynamic Ports
  5. Specify your port in TCP Port

You can use this port to connect to your instance by providing <servername>,<port> or <IP>,<port> as Server Name (yes, there is a comma, not a colon).

TCP-Ip static port

TCP-Ip static port

Conclusion:

We have explained some solutions to fix SQL Server Error 26 and SQL Server Error 40 and hope that you find the fix on those solutions. The both errors are included on the same article because they have almost the same troubleshoot. If you have any other solution worked for you comment below and we will try to include it on our article.

When you try to connect to a local instance, SQL Server will always attempt to use Shared Memory. This connection will work fine:

localhostSQL2012

This works in my scenario, and the connection is indeed using Shared Memory in this case.

SELECT session_id,net_transport,local_net_address,local_tcp_port
FROM sys.dm_exec_connections;

Results:

session_id  net_transport   local_net_address   local_tcp_port
----------  -------------   -----------------   --------------
53          Shared memory   <local machine>     NULL

If you want to try to override Shared Memory (not sure why, on a local machine) and force TCP/IP instead, you can’t mix that with specifying the named instance explicitly, at least in all instances I tried (no pun intended). The named instance forces SQL Server to map the instance name to the port number, using SQL Server browser, but this apparently can’t be done when you force TCP/IP in the first place (the whole point of using TCP/IP is so you go straight to the port and not bother with the browser). If your named instance happens to be running on its own IP address and forced to port 1433, you may be able to get this to work; you may also be able to get it to work if you are using a Client Network alias (but I could not).

I was able to connect if I looked up the current dynamic port assigned to that instance in Configuration Manager (in my case it was 49538), and then connect using tcp:localhost,49538:

Object Explorer with two connections, one shared memory and one TCP/IP

So now:

SELECT session_id,net_transport,local_net_address,local_tcp_port
FROM sys.dm_exec_connections;

Results:

session_id  net_transport   local_net_address   local_tcp_port
----------  -------------   -----------------   --------------
53          Shared memory   <local machine>     NULL
54          TCP             10.211.55.10        49538 

All variations I tried — across multiple machines and versions — where I tried to combine a named instance with overriding shared memory and use TCP/IP instead — yielded the same error that you received. This is both when I prefixed the server/instance name with tcp: and when I specified TCP/IP for the network protocol in the connection properties dialog.

Long story short: If you really need to force TCP/IP for a local connection, you’re going to need to use a fixed port for that instance, and specify the port. Or use 1433 (which will only work if there’s no default instance or if you have a dedicated IP address for that instance), then you won’t need to specify the port, but you’ll still need to specify the tcp: prefix or use that option in the connection dialog.

I do not suggest trying to disable Shared Memory. FWIW.

Понравилась статья? Поделить с друзьями:
  • Сочинение признавать свои ошибки почему важно уметь признавать свои ошибки
  • Сообщить об ошибке настройки
  • Состояние sql 23000 код ошибки 177
  • Сочинение огэ признать свои ошибки
  • Сообщить об ошибке на сайте яндекс