共用方式為


Server.ServerType 屬性

Gets the server type for the instance of SQL Server.

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

語法

'宣告
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public ReadOnly Property ServerType As DatabaseEngineType 
    Get
'用途
Dim instance As Server 
Dim value As DatabaseEngineType 

value = instance.ServerType
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public DatabaseEngineType ServerType { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property DatabaseEngineType ServerType {
    DatabaseEngineType get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member ServerType : DatabaseEngineType
function get ServerType () : DatabaseEngineType

屬性值

型別:Microsoft.SqlServer.Management.Common.DatabaseEngineType
A ServerType object that specifies the server type for the instance of SQL Server.

備註

The server type indicates whether the instance of SQL Server is a matrix or a singleton.

範例

C#

Server srv = new Server("(local)");
Console.WriteLine("The server type is " + srv.ServerType.ToString());

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "The server type is" $srv.ServerType

請參閱

參考

Server 類別

Microsoft.SqlServer.Management.Smo 命名空間

其他資源

使用集合

管理伺服器