Click here to Skip to main content
12,501,207 members (42,123 online)
Click here to Skip to main content
Add your own
alternative version


26 bookmarked

SQL Server Finder

, 29 Dec 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
A simple Windows screen host utility that returns connection information (server name and port number) for all instances of SQL Server 2005, 2000, and 7.0 on a local machine.

Screenshot - SqlServerFinderConsole.jpg


Do you need to determine connection information for one or more instances of SQL Server (versions 2005, 2000, 7.0) on your local machine (be it a server or a PC)?

Here is a simple solution to a problem that is a royal pain to deal with. Sure, if you are a DBA making an ODBC or a JDBC connection, it is not a big deal. Actually, it is a pretty routine affair. But to every one else trying to run a local instance of SQL Server, it is not so easy. I can't tell you how many developers, designers, test engineers, report writers, and other professionals we have supported over the years in this very endeavor.

If you can remember the last time you had to make an initial connection, you are probably nodding your head and chuckling. Many of you did it so long ago, you probably forgot where to get this information... especially the port number. I am sure there are many of you out there like me who wonder why gathering a few parameters and making a connection can be such a traumatic experience.


I have assisted others countless times for many years in getting third party tools and just getting connected to local instances of their DBMS.

Using the Code

The utility is simple to use. You can place the files in any directory on your local machine. To run the program, open up the command prompt, change the directory to where you placed the files, and type the following command line:

> run_SQLServerFinder.bat

The program will return the server name and the port number for any instance of SQL Server that is on your local machine. Shown below is the code:

<Job id="SQLServerFinder">
<Script language="JScript" src="Class_Connection.js"></Script>

Points of Interest

There are over 500,000 indexed pages on Google alone pertaining to connection problems with SQL Server, under the following keyword searches:

  • [connection problems "sql server"]
  • [troubleshooting connection "sql server"]
  • ["hard to connect" "sql server"]
  • [connect* pain "sql server"]


This is the first version of this utility. Updates for this program will be available here.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
United States United States
I have been involved in just about every aspect of software engineering imaginable over the past twenty years. In 1999 I was one of the leaders on a team to won the coveted Financial Times award for corporate education. I an adjunct faculty member in the University of Vermont's computer science department. I am one of the founders of DataExpressions and a principle architect/designer of the product dbOrchestra.

A great deal of the work I do and post is done in collaberation with my business partner Dr. Win-Bin Huang.

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 29 Dec 2007
Article Copyright 2007 by ericm1000
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid