ListSQLSvr  

Home
Up
What's New
DTS
SQL-DMO
SQL-NS
XP's
SQL Agent
Events
FAQ
Links
About...

 

ListSQLSvr.exe - Enumerate SQL Servers

version: 1.0x002

last updated: 17 February 2002

platform: SQL Server 2000 running Windows NT 4.0 and higher

Description:

Enumerate SQL Server instances on the network using the ODBC SQLBrowseConnect functionality.

 

SQLBrowseConnect enumerates SQL Server instances using a network broadcast. This means it will never be able to return a conclusive or complete list of SQL Server instances because:

  • Instances that are not up and running do not respond to the discovery broadcast. Only one instance has to be up on a machine, it can respond for all instances on a machine

  • Instances might respond after the timeout, which will exclude there response from the list

  • Instances might not be listening on the correct protocol, so will never receive the discovery broadcast

  • Network infrastructure, especially routers, might limit the effect/visibility of the broadcast, since most routers are configure not to relay broadcast request to the other side of the router.

ListSQLSvr can return extended information in the form of:

ServerName\InstanceName;Clustered:[Yes|No];Version:8.00.194

 

This information is only available for SQL Server 2000 instances, in case of a SQL Server 7.0 installation the extended information is omitted.

 

The version tag reflects the installed base version number, since it is not updated during a service pack installation. Stored in the Registry on the machine:

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceName>\MSSQLServer\CurrentVersion

REG_SZ CurrentVersion

 

While the REG_SZ CSDVersion version reflects the service pack version installed

 

See also EnumSQLSvr: enumerating SQL Server using the LAN Manager API NetServerEnum()

Usage:

ListSQLSvr.exe version 1.0x2

ListSQLSvr usage:

-S List SQL Server instances on specific server (default is all)
-X Return extended information from instances if available
-? This help screen

sample usage:
ListSQLSvr <CR>
Lists the names of all SQL Server instances
ListSQLSvr -X <CR>
Lists extended info of all SQL Server instances
ListSQLSvr -S MyServer <CR>
Lists all SQL Server instance names on MyServer
ListSQLSvr -S MyServer -X <CR>
Lists extended info of all SQL Server instances on MyServer

Sample output:

First example lists "all" SQL Server instances by name in a sorted list

ListSQLSvr <CR>
(local)
ASTERIX\DEV
gertd00$dev
IDEFIX\ENT2K
OBELIX

Second example lists "all" SQL Server instances by name in a sorted list with extended information (if available)

ListSQLSvr -X <CR>
(local)
ASTERIX\DEV;Clustered:No;Version:8.00.194
gertd00$dev;Clustered:No;Version:8.00.194
IDEFIX\ENT2K;Clustered:No;Version:8.00.194
OBELIX

Third example lists SQL Server instances on one machine

ListSQLSvr -S asterix
ASTERIX\DEV

Fourth example lists SQL Server instances on one machine with extended information (if available)

ListSQLSvr -S asterix -X
ASTERIX\DEV;Clustered:Yes;Version:8.00.194
 

Installation:

Simply copy ListSQLSvr.exe onto your machine.

Download ListSQLSvr.zip

Download ListSQLSvr-src.zip (Visual C++ 6.0 project)

Requirements:

MDAC 2.6 or higher, which is the MDAC version that is shipping with SQL Server 2000.

Planned functionality enhancements:

  • None
     

  • Other suggestions, ideas, please send email to ideas

***

Questions or problems regarding this web site should be directed to webmaster@sqldev.net.
Copyright © 1991-2003 SQLDev.Net. All rights reserved.
Last modified: 07/06/03.