Share via


Méthode Server.PingSqlServerVersion (String)

Gets the version number of the instance of SQL Server.

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

Syntaxe

'Déclaration
Public Function PingSqlServerVersion ( _
    serverName As String _
) As ServerVersion
'Utilisation
Dim instance As Server 
Dim serverName As String 
Dim returnValue As ServerVersion 

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

Paramètres

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

Valeur de retour

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

Exemples

C#

Server srv = new Server("(local)");
Console.WriteLine(srv.PingSqlServerVersion("(local)"));

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host $srv.PingSqlServerVersion("(local)")

Voir aussi

Référence

Server Classe

Surcharge PingSqlServerVersion

Espace de noms Microsoft.SqlServer.Management.Smo

Autres ressources

Appel de méthodes

Gestion des serveurs