Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
PingSqlServerVersion Method (String)
Collapse the table of content
Expand the table of content

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 : String
) : ServerVersion

Parameters

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

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)"));

PowerShell

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

Community Additions

ADD
Show:
© 2015 Microsoft