Metoda Application.GetServerInfo
Zwraca SQL Server numer wersja SQL Server produktu zainstalowanego na serwer docelowy.
Przestrzeń nazw: Microsoft.SqlServer.Dts.Runtime
Zestaw: Microsoft.SqlServer.ManagedDTS (w Microsoft.SqlServer.ManagedDTS.dll)
Składnia
'Deklaracja
Public Sub GetServerInfo ( _
server As String, _
<OutAttribute> ByRef serverVersion As String _
)
'Użycie
Dim instance As Application
Dim server As String
Dim serverVersion As String
instance.GetServerInfo(server, serverVersion)
public void GetServerInfo(
string server,
out string serverVersion
)
public:
void GetServerInfo(
String^ server,
[OutAttribute] String^% serverVersion
)
member GetServerInfo :
server:string *
serverVersion:string byref -> unit
public function GetServerInfo(
server : String,
serverVersion : String
)
Parametry
- server
Typ: System.String
Nazwa sprzętu serwera, aby sprawdzić, czy SQL Server wersja produktu.
- serverVersion
Typ: System.String%
Numer wersja SQL Server produkt zdefiniowany jako się parametru.
Uwagi
Wartością domyślną tej właściwość jest 9.
Przykłady
Poniższy przykład pobiera SQL Server numer wersja z określonego serwera.
static void Main(string[] args)
{
Application app = new Application();
String outParam;
app.GetServerInfo("yourserver", out outParam);
Console.WriteLine("Server version? " + outParam);
}
Sub Main(ByVal args() As String)
Dim app As Application = New Application()
Dim outParam As String
app.GetServerInfo("yourserver", out outParam)
Console.WriteLine("Server version? " + outParam)
End Sub