SmoApplication.EnumAvailableSqlServers Method (Boolean)
Enumerates a list of local available instances of SQL Server.
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
public static function EnumAvailableSqlServers( localOnly : boolean ) : DataTable
- Type: Boolean
A Boolean value that specifies whether local instances are listed or all instances available on the network.If True, only local instances are listed.If False, all instances are listed.
Return ValueType: DataTable
A DataTable system object value that contains an enumerated list of information about the available instances of SQL Server. The table describes the different columns of the returned DataTable.
The name of the instance of SQL Server.
The name of the server on which the instance of SQL Server is installed.
The instance of SQL Server.
A Boolean value that is True if the instance is participating in failover clustering, or False if it is not.
The version of the instance of SQL Server.
A Boolean value that is True if the instance is local, or False if the instance is remote.
The computer 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.