How To Connect To SQL Server From Another Computer?: 4 Answers
How To Connect To SQL Server From Another Computer?: 4 Answers
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
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...)
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.
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
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:
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.
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
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.
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.
Goto the Connections settings and make sure "Allow remote connections to this server" is ticket.