Partager via


InstanceName propriété

Gets the instance name of the instance of SQL Server. 

Espace de noms :  Microsoft.SqlServer.Management.Smo
Assembly :  Microsoft.SqlServer.Smo (dans Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
<SfcPropertyAttribute> _
Public ReadOnly Property InstanceName As String
    Get
'Utilisation
Dim instance As Server
Dim value As String

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

Valeur de la propriété

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

Notes

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.

Exemples

Console.WriteLine(srv.InstanceName)