Find All SQL Servers On A Network with sqlcmd

In the event that anyone should ask for it 🙂 we are compiling a list of All SQL Servers, Databases, and Contacts for each application we support in our environment.

We have a central repository, that’s updated daily, that houses that information.  That feed, however, and any documentation we create, is only as good as it is current.  We are human… and need to periodically review systems to ensure that we collect any that may have slipped through the cracks.  It’s also not a bad idea to see what’s out there that you may have forgotten about or were’nt even aware of…

Either the osql or sqlcmd utilities can be used to list all SQL Instances with the following syntax –

osql /L

sqlcmd -L

While both osql and sqlcmd are currently supported, it’s worth pointing out that the sqlcmd utility, was incorporated into SQL 2005, is more feature rich, and should be used going forward.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s