Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how to configure SQL Server 2005 for remote connection? I have to access a local SQL Server with a web application.

Thank you!

share|improve this question

When you installed SQL did you use the 'default' instance, or a 'named' instance? If you're not sure, take a look in your Services control panel (under Administrative Tools).

If the services for SQL have (MSSQLSERVER) after them, then you are on the 'default' instance. If they have anything else after them (e.g. (SQL2005)) then you are on a 'named' instance.

Connecting to the default instance is simple - just connect to the server name. If you are on a named instance, you need to connect to the server name, backslash () instance name.

Eg if your named instance is "SQL2005" then you would connect to SERVER\SQL2005.

With that in mind, what is the exact error message you are receiving?

share|improve this answer
I am getting this eror 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) – Manish Aug 31 '09 at 10:21
Depending on the situation, you may also check that the SQL Server Browser is enabled if using named instances. It is disabled by default on SQL Server Express. – Jeremy Aug 31 '09 at 12:26

This is done using the SQL Server Configuration Manager. There is a detailed how to available for all aspects of this process here.

  • Start / Programs / SQL Server 2005 / Configuration Tools / SQL Server Configuration Manager
  • SQL Server Network Configuration
  • Protocols for [ServerName]
  • Double click on TCP/IP and change it to Enabled
  • Restart the SQL Service under SQL Server Services.

Also check that your Firewall is allowing access to SQL Server. This Microsoft support article covers the exceptions needed for SQL Server on the Firewall.


Based on your error it seems like you might be using an incorrect connection string?

To connect to your machine from another site you should use either the Machine IP address or machine name, eg: [MACHINENAME][INSTANCENAME] or [MACHINEIP][INSTANCENAME]. Also if your in a corporate environment it may be a problem if you are behind a firewall or proxy since your machine is not directly accessible from the outside, and the webserver might only be visible from the inside of the network. If your running everything on your machine ensure that you can see the machine from outside of the network.

share|improve this answer
Thanks but I already done what u are tellingl, Still it is not working. – Manish Aug 31 '09 at 8:29
What's the error message you are receiving when you try and connect? – mrdenny Aug 31 '09 at 9:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.