SQL server instances list on remote IP

  • Thread starter Thread starter christof
  • Start date Start date
C

christof

I've asked on sql.programming, but got no answer:

Is there a way to get all the SQL Server instances with SQL SMO from a
remote computer?

I got few instances on some remote IP and
how to list them, how to pass to the function this address - could it be
done at all?

Second question:

Locally I'm using SmoApplication.EnumAvailableSqlServers, but
I've got SQLEXPRESS and MSDE SP 4, and got MYCOMPUTERNAME\SQLEXPRESS and
MYCOMPUTERNAME\MSDE2000 but if I do that:

DataTable dt = SmoApplication.EnumAvailableSqlServers(false);

if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
ddlSQLServerInstances.Items.Add(new
ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
}
}

In my dropdownlist appears only MYCOMPUTERNAME, nothing more...

I'll be happy for any suggestions.

Thank you!!!
 
Hi,

No idea really if you can do this directly, but maybe a possible way is
using WMI in the remote computer. Take a look at WMI and see if you can
enumerate the sql servers that way.

IIRC in VS.NET you can do it, so it can be done :)

cheers,
 
christof said:
I've asked on sql.programming, but got no answer:

Is there a way to get all the SQL Server instances with SQL SMO from a
remote computer?

I got few instances on some remote IP and
how to list them, how to pass to the function this address - could it be
done at all?

Second question:

Locally I'm using SmoApplication.EnumAvailableSqlServers, but
I've got SQLEXPRESS and MSDE SP 4, and got MYCOMPUTERNAME\SQLEXPRESS and
MYCOMPUTERNAME\MSDE2000 but if I do that:

DataTable dt = SmoApplication.EnumAvailableSqlServers(false);

if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
ddlSQLServerInstances.Items.Add(new
ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
}
}

In my dropdownlist appears only MYCOMPUTERNAME, nothing more...

I'll be happy for any suggestions.

Thank you!!!

What exactly do you mean by - appears only MYCOMPUTERNAME ?
How many name" do you have in your drop down list, 1 or 2.
What client and server side protocols do you have enabled? TCP/IP, Named
pipes, memory mapped?
Note that named pipes and memory mapped cannot be used for remote
connections from client to server.
What are the versions of the "remote" SQL servers? MSDE versions cannot be
used remotely.

Willy.


Willy.
 
Back
Top