Export (0) Print
Expand All
Expand Minimize

Server.InstanceName Property

Gets the instance name of the instance of SQL Server. 

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

[SfcPropertyAttribute]
public string InstanceName { get; }

Property Value

Type: 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.

Console.WriteLine(srv.InstanceName)
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft