Export (0) Print
Expand All

Server.PingSqlServerVersion Method (String, String, String)

Get the version number of the specified instance of SQL Server using the specified login and password to gain access.

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

'Declaration
Public Function PingSqlServerVersion ( _
	serverName As String, _
	login As String, _
	password As String _
) As ServerVersion
'Usage
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)

Parameters

serverName
Type: String
A String value that specifies the name of the instance of SQL Server.
login
Type: String
A String value that specifies the login.
password
Type: String
A String value that specifies the login password.

Return Value

Type: ServerVersion
A ServerVersion object value that specifies the version of the instance of SQL Server.

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)")
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft