Expand Minimize
This topic has not yet been rated - Rate this topic

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)
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.