Método SmoApplication.EnumAvailableSqlServers (String)
Enumerates a list of available instances of SQL Server that are installed on the computer with the specified instance name.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (em Microsoft.SqlServer.Smo.dll)
Sintaxe
'Declaração
Public Shared Function EnumAvailableSqlServers ( _
name As String _
) As DataTable
'Uso
Dim name As String
Dim returnValue As DataTable
returnValue = SmoApplication.EnumAvailableSqlServers(name)
public static DataTable EnumAvailableSqlServers(
string name
)
public:
static DataTable^ EnumAvailableSqlServers(
String^ name
)
static member EnumAvailableSqlServers :
name:string -> DataTable
public static function EnumAvailableSqlServers(
name : String
) : DataTable
Parâmetros
- name
Tipo: System.String
A String value that specifies the name of the computer on which the instances of SQL Server are installed or a single instance of SQL Server.
Valor de retorno
Tipo: System.Data.DataTable
A DataTable system object value that contains an enumerated list of information about the available instances of SQL Server on the specified computer.If a single instance of SQL Server is specified in the name parameter, instead of a computer name, results are returned for the specified instance only. The table describes the different columns of the returned DataTable.
Column |
Data type |
Description |
---|---|---|
Name |
The name of the instance of SQL Server. |
|
Server |
The name of the server on which the instance of SQL Server is installed. |
|
Instance |
The instance of SQL Server. |
|
IsClustered |
A Boolean value that is True if the instance is participating in failover clustering, or False if it is not. |
|
Version |
The version of the instance of SQL Server. |
|
IsLocal |
A Boolean value that is True if the instance is local, or False if the instance is remote. |
Comentários
The computer that is running the instance SQL Server might not receive responses to the EnumAvailableSqlServers method in a timely manner. The returned list might not show all the available instances of SQL Server on the network. When you call the EnumAvailableSqlServers method in subsequent tries, more servers might become visible on the network.
This method fails to list the local instance if a firewall is operating on the server. The firewall blocks any broadcast traffic issued when the method is called, even if the sender is from local machine.