You are on page 1of 3

How to connect to SQL Server from another computer?

Ask Question

I want to connect from home using SQL Server 2005 to another PC.

I had a look on the msd...but before connecting it says I should connect to another computer using the computer management and it didn't work out....I can
only connect to computers from my workgroup?

Thanks, Luisa

sql sql-server-2005 sql-server-2008 sql-server-ce

edited Mar 21 '10 at 10:04 asked Mar 21 '10 at 9:56


marc_s Luisa
537k 119 1040 205 1 4 15
1205

1 This question is not clear - can you explain what exactly are you trying to do ? – Dani Mar 21 '10 at 10:08

4 Answers

If you want to connect to SQL server remotly you need to use a software - like Sql Server Management
studio.

The computers doesn't need to be on the same network - but they must be able to connect each other
using a communication protocol like tcp/ip, and the server must be set up to support incoming
connection of the type you choose.

if you want to connect to another computer (to browse files ?) you use other tools, and not sql server
(you can map a drive and access it through there ect...)

To Enable SQL connection using tcp/ip read this article:

For Sql Express: express For Sql 2008: 2008

Make sure you enable access through the machine firewall as well.

You might need to install either SSMS or Toad on the machine your using to connect to the server. both
you can download from their's company web site.

edited Mar 21 '10 at 13:15 answered Mar 21 '10 at 10:10


Dani
10k 9 43 86

Yes I want to connect remotly...I have access tot the computer using run->mstsc. I set on sql configuration
manager protocol tcp/ip as enabled but how I do "the server must be set up to support incoming connection of the
type you choose." Thanks – Luisa Mar 21 '10 at 10:31

3 mstsc = Microsoft Terminal Services - that has nothing to do with SQL Server...... – marc_s Mar 21 '10 at 11:19

1 you are mixing 2 issues: when you use mstsc - you are actually on the remote machine. you don't need tcp/ip
cause you can admin it locally. I'll edit the answer with info how to enable remote access to sql server – Dani Mar
21 '10 at 13:10

1 Check also that SQL Server Browser service is running. That fixed my problem too. – kzfabi Nov 26 '12 at 18:15

Articles are useless. – Ali.Rashidi Feb 21 '16 at 9:01

Disclamer

This is just some additional information that might help anyone. I want to make it abundantly clear that
what I am describing here is possibly:

A. not 100% correct and


B. not safe in terms of network security.
I am not a DBA, but every time I find myself setting up a SQL Server (Express or Full) for testing or
what not I run into the connectivity issue. The solution I am describing is more for the person who is
just trying to get their job done - consult someone who is knowledgeable in this field when setting up a
production server.

For SQL Server 2008 R2 this is what I end up doing:

1. Make sure everything is squared away like in this tutorial which is the same tutorial posted above
as a solution by "Dani" as the selected answer to this question.
2. Check and/or set, your firewall settings for the computer that is hosting the SQL Server. If you are
using a Windows Server 2008 R2 then use the Server Manager, go to Configuration and then look
at "Windows Firewall with Advanced Security". If you are using Windows 7 then go to Control
Panel and search for "Firewall" click on "Allow a program through Windows Firewall".
Create an inbound rule for port TCP 1433 - allow the connection
Create an outbound rule for port TCP 1433 - allow the connection
3. When you are finished with the firewall settings you are going to want to check one more thing.
Open up the "SQL Server Configuration Manager" locate: SQL Server Network Configuration -
Protocols for SQLEXPRESS (or equivalent) - TCP/IP
Double click on TCP/IP
Click on the IP Addresses tab
Under IP1 set the TCP Port to 1433 if it hasn't been already
Under IP All set the TCP Port to 1433 if it hasn't been already
4. Restart SQL Server and SQL Browser (do both just to be on the safe side)

Usually after I do what I mentioned above I don't have a problem anymore. Here is a screenshot of
what to look for - for that last step:

Again, if someone with more information about this topic sees a red flag please correct me.

Hope this helps.

edited Jul 20 '11 at 18:39 answered Jul 20 '11 at 16:22


dyslexicanaboko
3,347 2 27 30

1 You should not explicitly need to set port 1433 in SQL server Configuration Manager. You do however, need to set
all the IP Addresses' "Enabled" properties to Yes. – Ian Kemp Jun 24 '14 at 11:22
all of above answers would help you but you have to add three ports in the firewall of PC on which SQL
Server is installed.

1. Add new TCP Local port in Windows firewall at port no. 1434
2. Add new program for SQL Server and select sql server.exe Path: C:\ProgramFiles\Microsoft SQL
Server\MSSQL10.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
3. Add new program for SQL Browser and select sqlbrowser.exe Path: C:\ProgramFiles\Microsoft
SQL Server\90\Shared\sqlbrowser.exe

answered Jan 2 '12 at 5:03


Mujassir Nasir
1,037 3 24 45

Thanks a lot man, these last 3 steps finally get it working, well done. – LuciusAgarthy Apr 20 '16 at 11:12

I'll edit my previous answer based on further info supplied. You can clearely ping the remote computer
as you can use terminal services.

I've a feeling that port 1433 is being blocked by a firewall, hence your trouble. See TCP Ports Needed
for Communication to SQL Server Through a Firewall by Microsoft.

Try using this application to ping your servers ip address and port 1433.

tcping your.server.ip.address 1433

And see if you get a "Port is open" response from tcping.

Ok, next to try is to check SQL Server. RDP onto the SQL Server computer. Start SSMS. Connect to
the database. In object explorer (usually docked on the left) right click on the server and click
properties.

alt text http://www.hicrest.net/server_prop_menu.jpg

Goto the Connections settings and make sure "Allow remote connections to this server" is ticket.

alt text http://www.hicrest.net/server_properties.jpg

edited May 20 '10 at 20:49 answered May 18 '10 at 8:25


Simon Hughes
2,967 3 17 40

You might also like