Application.GetServerVersionEx 方法

定义

返回版本、产品级别和其他指示安装的 SSIS 版本的值。

public:
 void GetServerVersionEx(System::String ^ server, [Runtime::InteropServices::Out] int % editionID, [Runtime::InteropServices::Out] Microsoft::SqlServer::Dts::Runtime::DTSProductLevel % ssisEditionID, [Runtime::InteropServices::Out] System::String ^ % productVersion, [Runtime::InteropServices::Out] System::String ^ % productLevel);
public void GetServerVersionEx (string server, out int editionID, out Microsoft.SqlServer.Dts.Runtime.DTSProductLevel ssisEditionID, out string productVersion, out string productLevel);
member this.GetServerVersionEx : string * int * DTSProductLevel * string * string -> unit
Public Sub GetServerVersionEx (server As String, ByRef editionID As Integer, ByRef ssisEditionID As DTSProductLevel, ByRef productVersion As String, ByRef productLevel As String)

参数

server
String

用于从中获取产品版本信息的服务器的名称。

editionID
Int32

包含一个指示产品版本的整数的 out 参数。 “注释”部分显示了 editionID 与版本名称之间的映射。

ssisEditionID
DTSProductLevel

包含枚举中的值的 DTSProductLevel out 参数。

productVersion
String

包含帮助/关于中所示的生成号的 out 参数,格式为 major.minor.build。

productLevel
String

提供 SSIS 服务器的 Service Pack 级别的 out 参数。

示例

以下示例显示了为每个 out 参数返回的值

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            String serverName = "yourServerName";  
            int ed;  
            DTSProductLevel prodLevel = new DTSProductLevel();  
            String prodVersion;  
            string prodReleaseLevel;     
            Application app = new Application();  
            app.GetServerVersionEx(serverName, out ed, out prodLevel, out prodVersion, out prodReleaseLevel);  

            Console.WriteLine("servernName:     {0}", serverName);  
            Console.WriteLine("Edition:         {0}", ed);  
            Console.WriteLine("prodLevel:       {0}", prodLevel);  
            //Console.WriteLine("prodVersion:     {0}", prodVersion);  
            //Console.WriteLine("prodReleaseLevel {0}", prodReleaseLevel);  
        }  
    }  
}  
Imports System   
Imports System.Collections.Generic   
Imports System.Text   
Imports Microsoft.SqlServer.Dts.Runtime   
Namespace Microsoft.SqlServer.SSIS.Samples   

    Class Program   

        Shared Sub Main(ByVal args As String())   
            Dim servernName As String = "yourServerName"   
            Dim ed As Integer   
            Dim prodLevel As DTSProductLevel = New DTSProductLevel   
            Dim prodVersion As String   
            Dim prodReleaseLevel As String   
            Dim app As Application = New Application   
            app.GetServerVersionEx(servernName, ed, prodLevel, prodVersion, prodReleaseLevel)   

            Console.WriteLine("servernName: {0}", servernName)   
            Console.WriteLine("Edition: {0}", ed)   
            Console.WriteLine("prodLevel: {0}", prodLevel)   
            'Console.WriteLine("prodVersion: {0}", prodVersion)   
            'Console.WriteLine("prodReleaseLevel {0}", prodReleaseLevel)   
            Console.WriteLine   
        End Sub   
    End Class   
End Namespace  

示例输出:

serverName: <your server name>

Edition: 4

prodLevel: Enterprise

注解

下表列出了参数的值 ssisEditionID

EditionID 版本名称
0xA485ED98 标准
0x6B9471A8 企业
0x81C1F4D2 开发人员
0x2467BCA1 Enterprise Evaluation

适用于