共用方式為


SmoApplication.EnumAvailableSqlServers 方法

Enumerates a list of available instances of SQL Server.

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public Shared Function EnumAvailableSqlServers As DataTable
'用途
Dim returnValue As DataTable 

returnValue = SmoApplication.EnumAvailableSqlServers()
public static DataTable EnumAvailableSqlServers()
public:
static DataTable^ EnumAvailableSqlServers()
static member EnumAvailableSqlServers : unit -> DataTable
public static function EnumAvailableSqlServers() : DataTable

傳回值

型別:System.Data.DataTable
A DataTable system object value that contains an enumerated list of information about the available instances of SQL Server. The following table describes the different columns of the returned DataTable

Column

Data type

Description

Name

String

The name of the instance of SQL Server.

Server

String

The name of the server on which the instance of SQL Server is installed.

Instance

String

The instance of SQL Server.

IsClustered

Boolean

A Boolean value that is True if the instance is participating in failover clustering, or False if it is not.

Version

String

The version of the instance of SQL Server.

IsLocal

Boolean

A Boolean value that is True if the instance is local, or False if the instance is remote.

備註

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.

範例

處理 SMO 事件

請參閱

參考

SmoApplication 類別

EnumAvailableSqlServers 多載

Microsoft.SqlServer.Management.Smo 命名空間