Server.PingSqlServerVersion Method (String)

Gets the version number of the instance of SQL Server.

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


Public Function PingSqlServerVersion ( _
    serverName As String _
) As ServerVersion
Dim instance As Server
Dim serverName As String
Dim returnValue As ServerVersion

returnValue = instance.PingSqlServerVersion(serverName)
public ServerVersion PingSqlServerVersion(
    string serverName
ServerVersion^ PingSqlServerVersion(
    String^ serverName
member PingSqlServerVersion : 
        serverName:string -> ServerVersion 
public function PingSqlServerVersion(
    serverName : String
) : ServerVersion


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

Return Value

Type: Microsoft.SqlServer.Management.Common.ServerVersion
A ServerVersion object value that specifies the version of the instance of SQL Server.