OSQL Returns Strange Results

SQL −L should locate all SQL Servers on the network, but lately I've seen OSQL −L return servers that don't have SQL Server or Microsoft SQL Server Desktop Engine (MSDE) installed. Why does OSQL −L show SQL Server running on machines that don't have SQL Server installed?

SQL Server Books Online (BOL) says that OSQL −L "lists the locally configured servers and the names of the servers broadcasting on the network." However, OSQL −L isn't a reliable way to find all SQL Servers. It reports the SQL Servers that have announced themselves over the network. However, it's easy for a fully functional SQL Server to hide itself. The BOL topics "Revealing SQL Server on a Network" and "How to reveal or cancel announcement of SQL Server on a network (Windows)" provide more information about how SQL Server does this.

BOL says that OSQL −L will return all servers that are broadcasting on the network and all locally configured servers. OSQL −L will report a locally configured server if you define an alias for a SQL Server on the local machine using the Client Network Utility regardless of whether or not a SQL Server is installed on the machine. I don't usually recommend third-party tools here, but I find that SQLPing, a handy shareware utility available from http://www.sqlsecurity.com, does a good job of finding SQL Servers on your network by interrogating UDP port 1434, which a SQL Server listener service uses. SQLPing comes in command-line, GUI, and .NET varieties.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.