ServiceInstanceId 属性

获取唯一标识此 SQL Server 实例的服务实例的 ID 值。

命名空间:  Microsoft.SqlServer.Management.Smo
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property ServiceInstanceId As String
    Get
用法
Dim instance As Server
Dim value As String

value = instance.ServiceInstanceId
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public string ServiceInstanceId { get; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property String^ ServiceInstanceId {
    String^ get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member ServiceInstanceId : string
function get ServiceInstanceId () : String

属性值

类型:System. . :: . .String
一个 In32 值,该值指定 SQL Server 的实例的服务实例 ID 值。

示例

C#

Server srv = new Server("(local)");
Console.WriteLine("The service instance ID is: " + srv.ServiceInstanceId);

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "The service instance ID is:" $srv.ServiceInstanceId

请参阅

参考

Planning a SQL Server Installation

其他资源