Server.InstanceName 속성

Gets the instance name of 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 InstanceName As String 
    Get
‘사용 방법
Dim instance As Server 
Dim value As String 

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

속성 값

유형: System.String
A String value that specifies the instance name of the instance of SQL Server.

주의

The InstanceName property specifies the name of the instance of SQL Server. This is usually the computer name but it may be a named instance that was specified during setup. InstanceName will return an empty string for the default instance.

C#

Console.WriteLine(srv.InstanceName)

PowerShell

Write-Host $srv.InstanceName

참고 항목

참조

Server 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

속성 설정

서버 관리