共用方式為


GetServerVersionEx 方法

Returns the edition, product level, and other values that indicate the version of SSIS installed.

命名空間:  Microsoft.SqlServer.Dts.Runtime
組件:  Microsoft.SqlServer.ManagedDTS (在 Microsoft.SqlServer.ManagedDTS.dll 中)

語法

'宣告
Public Sub GetServerVersionEx ( _
    server As String, _
    <OutAttribute> ByRef editionID As Integer, _
    <OutAttribute> ByRef ssisEditionID As DTSProductLevel, _
    <OutAttribute> ByRef productVersion As String, _
    <OutAttribute> ByRef productLevel As String _
)
'用途
Dim instance As Application
Dim server As String
Dim editionID As Integer
Dim ssisEditionID As DTSProductLevel
Dim productVersion As String
Dim productLevel As String

instance.GetServerVersionEx(server, editionID, _
    ssisEditionID, productVersion, productLevel)
public void GetServerVersionEx(
    string server,
    out int editionID,
    out DTSProductLevel ssisEditionID,
    out string productVersion,
    out string productLevel
)
public:
void GetServerVersionEx(
    String^ server, 
    [OutAttribute] int% editionID, 
    [OutAttribute] DTSProductLevel% ssisEditionID, 
    [OutAttribute] String^% productVersion, 
    [OutAttribute] String^% productLevel
)
member GetServerVersionEx : 
        server:string * 
        editionID:int byref * 
        ssisEditionID:DTSProductLevel byref * 
        productVersion:string byref * 
        productLevel:string byref -> unit 
public function GetServerVersionEx(
    server : String, 
    editionID : int, 
    ssisEditionID : DTSProductLevel, 
    productVersion : String, 
    productLevel : String
)

參數

  • editionID
    型別:System. . :: . .Int32%
    An out parameter containing an integer that indicates the edition of the product. The mapping of the editionID to the edition name is shown in the Remarks section.
  • productVersion
    型別:System. . :: . .String%
    An out parameter containing the build number as seen in Help / About, formatted as major.minor.build.
  • productLevel
    型別:System. . :: . .String%
    An out parameter providing the service pack level of the SSIS server.

備註

The following table lists the values for the ssisEditionID parameter.

EditionID

Edition Name

0xA485ED98

Standard

0x6B9471A8

Enterprise

0x81C1F4D2

Developer

0x2467BCA1

Enterprise Evaluation

範例

The following example shows the values returned for each out parameter

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

Sample Output:

serverName: <your server name>

Edition: 4

prodLevel: Enterprise