From: Bob on
Is there an MS-DOS command for "What MS-SQL Server instances on this box?"

I've tried:

sqlcmd -L

but it lists everything the box can see, not just what's on the box.
From: Adi on
On Jul 17, 1:48 pm, Bob <B...(a)discussions.microsoft.com> wrote:
> Is there an MS-DOS command for "What MS-SQL Server instances on this box?"
>
> I've tried:
>
> sqlcmd -L
>
> but it lists everything the box can see, not just what's on the box.

One way is to check the services on the box. I guess that you could
try and use SC utility. Also have to admit that there may be better
ways.

Adi
From: Aaron Bertrand [SQL Server MVP] on
Unplug the network cable, then try? :-)

Seriously, you can use the SMO method EnumAvailableSqlServers ... This
returns a DataTable that you can filter by comparing the value in Server to
the name of your machine, and only display those values.

Note though that if you have "hidden" any of your local instances, they
won't show up.

http://msdn.microsoft.com/en-us/library/ms210425.aspx





On 7/17/08 6:48 AM, in article
E7FF2628-18C7-4AF6-9CC7-67CFD5C4CE91(a)microsoft.com, "Bob"
<Bob(a)discussions.microsoft.com> wrote:

> Is there an MS-DOS command for "What MS-SQL Server instances on this box?"
>
> I've tried:
>
> sqlcmd -L
>
> but it lists everything the box can see, not just what's on the box.

From: Bob on
List servers on the box; sort of works

sqlcmd -Lc | findstr /I "<your_box_name>"


"Bob" wrote:

> Is there an MS-DOS command for "What MS-SQL Server instances on this box?"
>
> I've tried:
>
> sqlcmd -L
>
> but it lists everything the box can see, not just what's on the box.