Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How many sql server in the network?

Posted on 2002-06-27
2
Medium Priority
?
162 Views
Last Modified: 2010-05-03
Hi All,

How would I know how many SQL servers (server name) in the network?

Sean.
0
Comment
Question by:whsean
2 Comments
 
LVL 3

Accepted Solution

by:
DrMaltz earned 200 total points
ID: 7115619
there's an API called NetServerEnum which will enumerate the number of SQL Servers broadcasting on the network (Named Pipes a protocol). You can pass an option to this function that finds any server running Microsoft SQL Server.  Here's an article.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/ntlmapi2_1vl9.asp

Here's an article showing how to accomplish from vb.. http://www.codeguru.com/vb/articles/1916.shtml

Also, you can take a look at the SQL DMO Object. Using the SQL-DMO object model you can programmatically control SQL Server.  It contains a method ListOfAvailableServers.

Hope this helps.
Good Luck

DrMaltz
0
 

Author Comment

by:whsean
ID: 7117728
Thanks a million!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question