Server.ServiceInstanceId Server.ServiceInstanceId Server.ServiceInstanceId Property

Definition

Gets the ID value that uniquely identifies the service instance for this instance of SQL Server.

public:
 property System::String ^ ServiceInstanceId { System::String ^ get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcProperty(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Expensive | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Standalone)]
public string ServiceInstanceId { get; }
Public ReadOnly Property ServiceInstanceId As String
Property Value

A Int32 value that specifies service instance ID value for the instance of SQL Server.

Examples

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  

Applies to