Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Get the version number of the specified instance of SQL Server using the specified login and password to gain access.
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, _
login As String, _
password As String _
) As ServerVersion
'Utilisation
Dim instance As Server
Dim serverName As String
Dim login As String
Dim password As String
Dim returnValue As ServerVersion
returnValue = instance.PingSqlServerVersion(serverName, _
login, password)
public ServerVersion PingSqlServerVersion(
string serverName,
string login,
string password
)
public:
ServerVersion^ PingSqlServerVersion(
String^ serverName,
String^ login,
String^ password
)
member PingSqlServerVersion :
serverName:string *
login:string *
password:string -> ServerVersion
public function PingSqlServerVersion(
serverName : String,
login : String,
password : String
) : ServerVersion
Paramètres
- serverName
Type : System.String
A String value that specifies the name of the instance of SQL Server.
- login
Type : System.String
A String value that specifies the login
- password
Type : System.String
A String value that specifies the login password.
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)", "SampleLogin", "SampePassword"));
PowerShell
$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)", "SampleLogin", "SamplePassword")
Write-Host $srv.PingSqlServerVersion("(local)")
Voir aussi
Référence
Surcharge PingSqlServerVersion
Espace de noms Microsoft.SqlServer.Management.Smo