You are on page 1of 16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

How to enable remote connections in SQL Server 2008?


Daniel_Walzenbach 14 Apr 2010 3:36 PM

54

You experience the following error message: 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)

How to solve this issue? There are a couple of things that might be going on here (All of the following configurations are made on the computer running your SQL Server 2008 instance) Allow remote connections to this server The first thing you want to check is if Remote Connections are enabled on your SQL Server database. In SQL Server 2008 you do this by opening SQL Server 2008 Management Studio, connect to the server in question, right click the server

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

1/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

and open the Server Properties .

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

2/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Navigate to Connections and ensure that Allow remote connections to this server is checked. Check if this solves the problem. If it does, here you go, continue with whatever you were doing and have a nice day. Protocols for MSSQLServer If youre still running in issues lets dig a bit deeper. The next good thing to check is the SQL Server Network Configuration. Open the SQL Server Configuration Manager, unfold the node SQL Server Network Configuration and select Protocols for MSSQLServer (or whatever the name of your SQL Server instance is).

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

3/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Make sure that TCP/IP is enabled and try again. Even though I hope that this resolved your problems there might still be an issue with The Firewall If there is still no communication happening between your computer and the remote SQL Server you most likely need to configure your firewall settings. A good first step is to figure out which port is being used by TCP/IP (and which you need to open in your firewall). You can do this by right clicking TCP/IP and selecting Properties .

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

4/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Click on the tab IP Addresses and voil Port 1433 it is :-) That was easy enough and all there is left to do is to allow inbound TCP/IP traffic on Port 1433 in your firewall. In Windows 7 this works something like this. Open the Control Panel and navigate to Windows Firewall.

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

5/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Click on Advanced Settings on the left hand side and you should see the Windows Firewall with Advanced Security. Select the Inboud Rules on the left hand side and click on New Rule on the right hand side.

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

6/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

This opens the New Inbound Rule Wizard which you can use to allow inbound traffic on Port 1433 for TCP/IP (and which is exactly how you configured your SQL Server in the steps above). Just follow the steps outlined below and you should be good :-)

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

7/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

8/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

9/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

10/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

11/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Thats it, success! From here you should be able to access your SQL Server remotely. Enjoy! Cheers! Daniel P.S. There's a good article on msdn on this topic if you're looking for additional information >> Configuring the Windows Firewall to Allow SQL Server Access. Update (June 14th, 2010): If you're running into SQL Server Error Code 26 check out SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified If you're running into SQL Server Error Code 10060/SQL Server Error Code 10061 check out SQL Server Error: 10060 \ SQL Server Error: 10061

Comments
blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx 12/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Oliver Bradley

15 Apr 2010 6:38 AM I see red X's instead of your screenshots.

Behtash Moradi

17 Apr 2010 1:31 AM it is very good article.Thank you indeed.

Gerhard

20 Apr 2010 1:25 AM Hey Daniel, very nice article! One comment: Many enterprise firewalls are blocking the UDP-Ports. By default SQL-Server-BrowserServices use UDP-Port 1433. System administrators are not very happy when you ask them to open UDPPorts, because they are frequently used for cyber-attacks. If SQL-Server-Browser-Services are not available, you cannot find the named instance of you server. An easy workaround is to append the TCP-Port of your server instance (in this case 1433) to the server address (e.g. 234.567.123.23, 1433) Not using SQL-Server-Browser-Services and blocking UDP-Ports makes systems much safer at no cost of usability. cheers

Daniel_Walzenbach

20 Apr 2010 9:55 AM @Oliver >> do you still have issues seeing the pictures? @Gerhard >> Great tip! Thanks very much!

Grant

11 May 2010 7:13 AM Thank you!! This is a very good article and it sorted my problem out. So much for the technet and MSDN online help.

Vadim

21 Jan 2011 6:52 AM How to enable remote connections in SQL Server 2008 into Windows Server 2008 R2 Core?

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

13/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Salim

14 Jul 2011 5:33 AM thank u so much ...it helps me lot..keep up ur good work.

JayB

2 Aug 2011 6:00 AM Step 1>Install MS SQL server 2008 Step2>During Istallation Always Select MIXED User connection; Step3>after successful installation of data base Login as Local User.and create Database..then in side Database select security and then right click on login and create new Login. Step4>give new User name and Select SQL Authentication..and give password then deselect USE MUST CHANGE PASSWORD AT NEXT LOGIN Step5>Go to USER MAPPING on that form and select database wihich u want to assign to that User.and below that assign read,write,backup permission.and then Click "ok" to finish. Step6>NOW open SQL Server Configuration Manager->SQL Server Network Configuration->Protocols for <Instance Name>->Enable Shared Memory & TCP/IP and Double Click on TCP/IP then got to IPaddress TAB->in here ScrollDown and look "IP ALL"there give TCP Port "1433" then "ok". Step7>Now Go to SQL NATIVE Client xx.x Configuration->Client Protocols->Enable Shared memmory and TCP/IP->Double click on Client Protocols and Default Port =1433 Step8 Optional Client side>Go to Aliases and create new Alias.eg-Alias name=xyz,)port no=1433,Protocol=TCP/IP,Server=Ip Add (192.168.1.1) or DomainName\InstanceName(JOI-MI\MSSQLSERVER) Step9>do Step 6 & 7 in client Side. Note:-Remember Do all settings of SQL Server Configuration Manager in 32-bit version.ull see don't worry. Use this Connection string -> cnn = New SqlConnection("Data Source=<Alias name/ipaddress,port>;Network Library=DBMSSOCN;Initial Catalog=DATAbaseNAME;User ID=SQLCreatedUSERname;Password=Pass;")

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

14/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Duncan

11 Aug 2011 9:19 PM Thank you so much for this. Saved me at midnight for a launch tomorrow!

Hussain

26 Aug 2011 4:47 PM I didn't try your solution yet, but realy I want to thank you very much for your explanation.

Roshan

28 Oct 2011 12:27 AM I tried till the step of enabling TCP. I still could not connect to database remotely. Windows firewall was off. I restarted sql server service. Then it worked :)

oracle boy

6 Nov 2011 1:35 AM what kind o microsoft IDIOT mind this ? what for ??? this way Everybady open ALL ! IDIOT !!!

kenan

30 Nov 2011 5:25 AM have you can do this automaticly with code

Hunk RE

2 Dec 2011 5:29 PM This is good guide, but you forgot that it is needed to create specific username and password to establish connections to the server, also select wich logins are going to be used to access the database, this is could be all done from the management studio, and the most important is you should enable sql server authentication and windows from the properties -> security. more info: videotutors.net/sqlserver-remoteaccess.aspx

Syed Irfan

11 Jan 2012 10:15 PM


blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx 15/16

03/05/13

How to enable remote connections in SQL Server 2008? - <dw:daniel_walzenbach runat="server" /> - Site Home - MSDN Blogs

Thanks you dear this is very helpful document i have deployed its successfully.

blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx

16/16

You might also like