Server.Name Property

Gets the name of the server, which is the physical machine name.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
<SfcPropertyAttribute> _
<SfcKeyAttribute()> _
Public ReadOnly Property Name As String
    Get
'Usage
Dim instance As Server
Dim value As String

value = instance.Name
[SfcPropertyAttribute]
[SfcKeyAttribute()]
public string Name { get; }
[SfcPropertyAttribute]
[SfcKeyAttribute()]
public:
virtual property String^ Name {
    String^ get () sealed;
}
[<SfcPropertyAttribute>]
[<SfcKeyAttribute()>]
abstract Name : string
[<SfcPropertyAttribute>]
[<SfcKeyAttribute()>]
override Name : string
final function get Name () : String

Property Value

Type: System.String
A String value that specifies the name of server.

Implements

IAlienRootName()

Examples

Console.WriteLine(srv.Name)