ServerType 屬性
取得 SQL Server 執行個體的伺服器類型。
命名空間: Microsoft.SqlServer.Management.Smo
組件: Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)
語法
'宣告
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Expensive 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.Expensive|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public DatabaseEngineType ServerType { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Expensive|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property DatabaseEngineType ServerType {
DatabaseEngineType get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member ServerType : DatabaseEngineType
function get ServerType () : DatabaseEngineType
屬性值
型別:Microsoft.SqlServer.Management.Common. . :: . .DatabaseEngineType
ServerType 物件,指定 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