Connecting to a Remote SQL Server
page 1 of 1
Published: 29 Dec 2004
Unedited - Community Contributed
Sometimes you cannot log in locally to a SQL server, so you need to make a remote connection. Usually this is over the Internet using TCP/IP. Tools that you can use to connect to a remote SQL server are Enterprise Manager, Query Analyzer, or even through code. Enterprise Manager and Query Analyzer are part of the SQL Tools and can be found in the SQL Server installation disk.
by Web Team at ORCS Web
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 12300/ 18

Sometimes you cannot log in locally to a SQL server, so you need to make a remote connection. Usually this is over the Internet using TCP/IP. Tools that you can use to connect to a remote SQL server are Enterprise Manager, Query Analyzer, or even through code. Enterprise Manager and Query Analyzer are part of the SQL Tools and can be found in the SQL Server installation disk. You can download an evaluation version of SQL Server from Microsoft's web site. Once the trial period has elapsed the local database will no longer function, but the SQL Client tools will continue to operate fine.

Configuring SQL Connection Alias
Once you have installed the SQL Server Client Tools on your local workstation or server, you can find the tools under the Start menu (on your desktop)- Programs - Microsoft SQL Server. Select the option called Client Network Utility.

In the Networking Utility click on the alias tab, then click add. Below is a picture of the add alias window.

Make sure TCP/IP is selected in the Network libraries. By default, the SQL 7.0 client tools use Named Pipes protocol. In the Server alias field enter the fully qualified domain name or the IP address of the SQL server you are connecting to. The Connection parameters are filled in automatically. Click OK to exit both of the opened windows.

Configuring Enterprise Manager
Now that the location of the SQL Server and the protocol to use has been configured, you are ready to configure your Enterprise Manager. Open Enterprise Manager, which is found under Microsoft SQL server in your Start Menu.

In the Tree view on the left side of the application window, expand Microsoft SQL Server. Right click SQL Server Group and select New SQL Server Registration. Click next. The next window is displayed below.

Select the alias that you just created and click add and then next. In the next window, select SQL Server Authentication and click next. Enter your SQL server username and password and click next twice and then finish.

Enterprise Manager will then connect to the SQL server and authenticate your username and password. You also can now connect with Query Analyzer using the same connection alias you created for Enterprise Manager.

By Benjamin Higgins

User Comments

Title: worked like a charm   
Name: Dave
Date: 2012-02-10 11:28:58 AM
Great job. Still works even after all these years
Title: SQL Server 2008 remote connection   
Name: Bud Aaron
Date: 2010-06-15 3:42:51 PM
For a complete step by step set of instructions for enabling remote connections on SQL 2008 try here:
Title: Please Help me   
Name: Alkesh Nayak
Date: 2010-06-02 1:42:28 PM
My Sql Server Is On windows server2003,
I want to access it via internet.
What will be the pre- requirment of my Project in and
I am new in this field.
Title: hi   
Name: chirag
Date: 2010-03-10 3:54:42 AM
please give discription in deep.
the solution you have given is not enough. & it is meaning less
anyone can't understand using this tutorial
so change your style
Title: Thanks for article   
Name: Kuldeep bhojak
Date: 2009-10-28 6:56:35 PM
This is very useful article
Title: connect to RDP   
Name: amar
Date: 2009-06-05 2:32:03 AM
Thank u.
Title: Remote Access   
Name: Manish.M.Meshram
Date: 2009-05-13 3:34:19 AM

My Sql Server Is On windows server2003,
I want to access it via internet.
What will be the pre- requirment of my Project in and
I am new in this field.
Thanks for your Kind Reply
Title: SQl 2000 not connecting to remote server   
Name: Mike
Date: 2009-03-10 6:37:50 AM

Please can some one help me. I have installed sql server 2000 in the office server and tried connecting through querry analyser and ent manager but i am experiencing eror saying server does not exist. Meanwhile i have configured the client network utility and server network utility on both ends.

I tried telnet server_ip 1433 and no connection.

Pls advice me on what to do. My client and server os is Win Xp.

Title: Excellent - Solved my confusion!   
Name: TJ Benoit
Date: 2009-01-13 3:14:51 PM
Thank you! This was exactly what I needed..
Title: Re: SQL Server connection error   
Name: Desiree
Date: 2008-12-09 1:08:50 PM

You will need to have the SQL server name or IP address to properly connect.

Title: SQL Server connection error   
Name: Ram
Date: 2008-12-09 2:10:53 AM
I'm trying to create the new alias name.but it is not taken the is giving the error."server name is not correct" i finding this do find out to connect to the my local database without knowing server name.
Title: Remote SQL server connection error   
Name: Neelesh Soni
Date: 2008-11-24 4:01:50 AM

I am trying to connect to a remote SQL server in Australia.
using ODBC, I am using the IP address of server, they have enabled connection for remote access, but I m getting error that server does not exists, but I am able to ping the server.
please help
Title: Re: doesn't work   
Name: A
Date: 2007-11-26 12:16:51 PM

I will need you to explain what you are doing in further detail before I can provide additional direction on connecting to the remote SQL Server. One thing to check is the connection to the remote SQL Server. Open a command prompt and ensure you can telnet to it on the SQL port by typing "telnet server_ip 1433" (be sure to put the actual server ip address in place of "server_ip"). If you are able to connect, everything should work properly otherwise the connection is blocked and that will need to be solved first. I hope this helps.


Title: doesn't work   
Name: A
Date: 2007-11-25 8:42:58 AM
Thanks for a very nice article.

I followed the procedure as described above but in the last step after clicking on finish button nothing happens but my sql server window gets closed. I again open sql server window to see no change.This is repeatedly happening.

Please Help.
Thanks in advance.
Title: Wonderful   
Name: G
Date: 2007-09-25 12:18:39 AM
Wonderful...Very Useful.
Title: Connecting Sql 2000 Database To visual studio and also i need the code snippet to save ,modify,delete and also for graph generation.   
Name: saranya
Date: 2007-09-04 1:09:59 PM
This is an informative article for all of us in i.t field
Title: Re: to move the site from one server to another or database is moved from one server to another   
Name: Desiree
Date: 2007-05-29 10:45:50 AM

There are several changes that are needed when moving a website or a database to another location/server. There are so many factors to consider, it's hard to give a list of things that are needed. Are you moving the website to a web host? If so, they will provide you with the information and tools you need to start uploading your website content and database to their servers so you can test before updating DNS to point to the new location. If your website content uses any absolute paths, you may want to consider changing them to relative ( Connecting to the database at the new location is as simple as updating the connection string to point to the server once the data has been uploaded. I hope this helps.


Desirée B. Harris
Windows 2000 MCDBA
Title: to move the site from one server to another or database is moved from one server to another   
Name: Pavan Kumar.P
Date: 2007-05-28 7:55:45 AM
Hai to Everybody,
I want to create a website with several webpages in ASP.NET in my own computer and also providing some ODBC Connections to Database that I have to call in Application serverat some other place.If will change the path of webpages that automatically updated when the client reads this websiteI want to move this website to different application servers.What is the approach I have to implement..waiting for the response
Title: unable to connect to yahoo's games rooms   
Name: george koutsodontis
Date: 2007-05-06 8:23:49 AM
hello all.
i am connected with my son's computer via lan cable.I can open all sites but my problem is that i cant get into the yahoo's game says unable to connect to server..
i was getting into rooms right away with my son's pc before using the lan something wrong with the yahoo's game server or there is something i must do.
please give me a hand to solve my problem.
thank you very mucm or
Title: Re: Connection Breaks   
Name: Desiree
Date: 2007-05-03 10:32:04 AM

I recommend starting a constant ping to the remote SQL Server while you are working. When you get disconnected, check your pings to see if it is your internet connection. If it is, you will want to contact your ISP. If it isn't, I recommend contacting the network administrator for further assistance. I hope this helps.

Thank you,

Desiree B. Harris
ORCS Webteam
Title: Connection Breaks   
Name: Giri
Date: 2007-05-03 2:32:47 AM
getting disconnected from sql server while working. Some time the connection is okey. But in some time it fails is it network problem sql?
Title: help   
Name: mash
Date: 2007-03-24 6:00:31 PM
Hello gentle men!
1st I would like to thank for your cooperations.
My problem is that:

How can I connect to a sql server databse on a remote computer using a code, like that I use the following code to connect to a local computer using the following code:
Title: not useful   
Name: saran
Date: 2007-01-24 7:48:44 AM
i have installed sqlserver and clienttools in my system and i want to connect a server that has the ip ''.
and my system is getting internet connection via proxy(using free proxy software).the ip server not connecting.i configured in sql server as u told above.
Title: oneofdev   
Name: email me if the problem exist
Date: 2007-01-09 1:12:42 AM
Title: sql connection doubt   
Name: one of devs
Date: 2007-01-09 1:10:27 AM
i used Proxifier 2 or 2.5,
and it solved,
EntManager send its data to localhost
and proxifier redirects it to a
Socks Proxy server,
i connected to a database by this solution,
hope to be use full
Title: sql connection doubt   
Name: Scott Forsyth
Date: 2006-12-28 2:46:42 PM
Hi sql doubt,

Your network administrator would need to help with that. Generally speaking though, if your proxy server is on the client side (the side using Enterprise Manager), then you probably don't need to worry as long as your firewall/router allows outgoing connections. If it is on the inside, then you will need to set up your NAT server or set up a route on your router to forward port 1433 to the SQL Server computer.
Title: sql connection doubt   
Name: sql doubt
Date: 2006-12-27 8:50:06 AM
i am using internet through a proxy server in a network.then how can i connect using a ip address to a domain
Title: Problem connecting with alias vs IP   
Name: creekau
Date: 2006-11-16 4:17:04 AM
The problem is that I can connect to a remote server with IP directly, but when i try to use an alias it won't connect. I used the same ms sql server kit to both of the servers(with SP4). I filled correctly the ip's of the remote server, i have connextion, the firewall is off, all settings are ok(i think), but still won't work with alias. It has to work with alias becaose the replications use the alias name.
Title: mmm   
Name: Palmant0
Date: 2006-11-06 2:27:54 PM
You are the chairman of the Remote SQL Server Company.thx a lot
Title: RE: Sql Server is not running   
Name: Desiree
Date: 2006-09-01 3:55:05 PM

It sounds like you should check the server properties to ensure the SQL Server service is running and configured properly. Another thing to try is pasting the exact error into Google to see if you find any useful information/articles. It's likely that other people have experienced the same issue and have solved it. I hope this helps.

Title: Sql Server is not running   
Name: Thaneshwar Jaglan
Date: 2006-09-01 3:37:18 AM
Explanation is very clear and concise but I got the connection failed error while connecting to remote sql server after registraion.IP adrress, password and user id are correct. It Gives me the message" remote sql server is not knowing to run"
Title: RE: still showing error   
Name: Desiree
Date: 2006-08-31 8:33:59 AM

It's likely that the server name and/or IP address you are using to connect to the SQL Server is incorrect. Try opening a command prompt and try to telnet to the server on port 1433 (type "telnet servername 1433" [without quotes] - replace servername with the actual server name). If it doesn't connect you will need to get the correct server name, IP address and/or port.

Title: still showing error   
Name: kiran
Date: 2006-08-31 6:56:16 AM

summary is good but i tried above procedure but showing error message... Sql server doesnot exists or access denied
pls do need ful help... send solution to above url
Title: CEO   
Name: Anil Gupta
Date: 2006-08-31 1:04:01 AM
This article was really helpful
Title: A lot of thanks   
Date: 2006-08-26 7:08:08 AM
good articals and mor help full
Title: Re: Dr   
Name: Desirée
Date: 2006-08-03 8:33:02 AM
Hi Simon,

I'm glad you found the article helpful. Have a great day!

Title: Dr   
Name: Simon - Estona Internet Marketing Ltd
Date: 2006-08-03 2:37:00 AM
Thank you folks! This kind of thing can waste hours of time when first attempting it and not knowing what you don't know but these instructions got straight to the point and worked perfectly.
Title: denis   
Name: akulay
Date: 2006-07-31 10:37:09 AM
Denis Akulay @ this is helpful
Title: System Administrator   
Name: Tracy
Date: 2006-07-25 2:56:55 PM
I had never done this before. This article walked me straight through the process without a hitch! Seems like it is hard to find helpful articles that get straight to the point, but this one proves me wrong. I like it!
Title: Remote Sql Server Connection   
Name: Desiree
Date: 2006-06-22 8:31:38 AM
Try using Microsoft's Web Data Admin Tool:

Title: Remote Sql Server Connection   
Name: Abhishek Pushker Pandey
Date: 2006-06-22 7:38:40 AM
Dear Sir,
I have a query regarding remote SQL Server Connection in C#.Net. Let me exlain you the scenario. A company has two branches in two different cities. Let it be CityA and CityB. CityA holds the Server Machine on which a SQL Server is installed and running. CityB wants to connect to SQL Server running at CityA. But make sure that both of these use only internet to communicate. Moreover, SQL Server is not running on a web server or intranet scenario. Please help !!!
Title: Mr   
Name: Pawel
Date: 2006-06-21 5:22:42 AM
Thank you for the help - most useful! :)
Title: Yeah!   
Name: Glauber Exorcista
Date: 2006-05-30 4:12:07 PM
Yeah, it worked pretty fine! Thanks Ben!
Title: TY   
Name: IronManKo
Date: 2006-05-30 4:09:26 PM
Thank you for this :)

it will help me greatly in the coming days as i am currently setting up a game server for knight online with the help of a few others, and need them to have remote access to the database :)
Title: nice to read   
Name: vin_chattu
Date: 2006-05-23 5:53:23 AM
I cleared my doubt..thank uuuuu
Title: Thanks for the article   
Name: Mani
Date: 2006-05-23 4:33:49 AM
cheers.. that was helpful
Title: Connect to Remote database   
Name: Steve Schofield
Date: 2006-05-02 10:16:31 AM
From what you are describing, you need to check with your Proxy or Firewall administrator to see if they can forward or open port 1433. This is the port SQL Enterprise manager uses.
Title: Unable to Connect   
Name: Irfan Aslam Bhatti
Date: 2006-05-02 9:11:46 AM
I still unable to Registrater the SQL Server on the Remote location. Please tell me if I can connect it under proxy environment.
Looking forward,
Title: Thanks   
Name: Shibu Antony C
Date: 2006-05-01 4:40:04 AM
Thank u very much it's really usefull. i was searching for this.

Title: Incredibly helpful   
Name: Scott Barnett
Date: 2006-03-31 11:34:26 PM
This was incredibly helpful. Thank you.
Title: Hats off to you!   
Name: Nisar
Date: 2006-03-29 10:30:39 AM
Hey Benjamin,

You have posted one of the coolest article. This has resolved my night mare about remote connectivity with SQL as all other articles were too complex. You did a great job and it really reflects.
Title: MS SQL Sever   
Name: Madhu
Date: 2006-03-27 7:52:40 AM

This article is most useful. Very informative. Cleared my many doubts.


Title: Re: Do it in Code?   
Name: Desiree
Date: 2006-03-20 4:44:20 PM
Hi Larry,

This article is specific to accessing a database remotely using Enterprise Manager / SQL Utilities for administration. What exactly are you trying to accomplish by using code? If you are referring to accessing the database data via remote queries, then, yes, that can be done via code. But, you'll need to search google (or another search engine) to find the answer to this as there are a number of ways to do this.

I hope this helps.

Title: Do it in Code?   
Name: Larry George
Date: 2006-03-20 4:19:28 PM
Is there anyway of doing this in Code? Like C#
Title: Connecting to a Remote SQL Server   
Name: Md. Yousuff
Date: 2006-03-08 2:36:14 AM
It is really helpful, straight to the point.
Excellent !!
Thanks Benjamin Higgins.
Title: Adding SQL Server   
Name: Steve
Date: 2006-03-02 1:07:19 AM
I would verify port 1433 is open on your local firewall or router. This generally is the issue. Also make sure the port 1433 is also open to the server.
Title: Not working   
Name: samir
Date: 2006-03-02 12:00:41 AM
Still it is not working Access denied error
Title: Mr.   
Name: Varun
Date: 2006-02-16 3:19:49 AM
Most helpful, and easy to use and implementation
Title: RE: Nice   
Name: Desiree
Date: 2006-02-15 11:50:37 AM
Hi Rama Krishna,

I'm not sure I understand your question. In order to connect to a remote SQL Server you must have either the server name or IP Address. If you have the server IP address, you can use it in place of the server name. If this doesn't answer your question, please further explain your problem. Thanks.

Title: Nice   
Name: rama Krishna
Date: 2006-02-13 7:00:05 AM
Hai I want how to configration to my remote sql server. but i know where it would u pls expain to me in remote sql server. that is without our LAN
Title: Connecting to remote sql server   
Name: Steve Schofield
Date: 2005-12-12 8:23:34 AM

I would verify port 1433 is open on your local firewall or router. This generally is the issue. Also make sure the port 1433 is also open to the server.

Title: Still can't connect   
Name: Burhan
Date: 2005-12-12 7:32:48 AM
well the article is fine, but i am not being able to connect. it keeps on saying 'SQL Server doesnot exists or access denied'. Is this due to some network security?
(I am sure that the IP , username and password are correct.)
Title: thanx   
Name: cobra
Date: 2005-11-30 2:06:19 AM
The article is really nice.I am also facing a problem while connecting to a remote server.This thing i want knowing .Thanx

Title: Mr   
Name: Marcel
Date: 2005-11-02 5:02:10 AM
Nup, still dosnt work
Title: Excellent !!! 10Dots.Net   
Name: Mario
Date: 2005-10-15 2:59:47 PM
Excellent article, concise and exactly right. Now I am connected!
Title: Excellent   
Name: Sas
Date: 2005-09-16 11:22:32 PM
Excellent summary. Really useful. Thanks Benjamin.
Title: mr   
Name: denisianum
Date: 2005-07-15 12:44:14 PM
thx are the only one that has talked about this on da net,it looks like.
Title: Thanks for the article   
Name: Bryce
Date: 2005-07-04 7:50:37 PM
Most helpful, straight to the point.


Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-18 5:30:42 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search