是否可以在LoadPackage()中使用DTS包(.dts)而不是ssis(.dtsx)?

时间:2009-07-01 12:49:54

标签: vb.net ssis

代码

Class ApplicationTests
        Shared  Sub Main(ByVal args() As String)
            ' The variable pkg points to the location of the
            ' ExecuteProcess package sample installed with
            ' the SSIS samples.
            Dim pkg As String =  "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx" 

            Dim app As Application =  New Application() 
            Dim p As Package =  app.LoadPackage(pkg,Nothing) 
           ' Now that the package is loaded, we can query on
           ' its properties.
            Dim n As Integer =  p.Configurations.Count 
            Dim p2 As DtsProperty =  p.Properties("VersionGUID") 
            Dim pl As DTSProtectionLevel =  p.ProtectionLevel 

            Console.WriteLine("Number of configurations = " + n)
            Console.WriteLine("VersionGUID = " + p2)
            Console.WriteLine("ProtectionLevel = " + pl)
        End Sub
End Class

在上面的代码中,是否可以在LoadPackage()中使用DTS包(.dts)而不是ssis(.dtsx)?或者给我一个加载DTS包的解决方案..

1 个答案:

答案 0 :(得分:1)

由于你使用的是2005+,我相信它只适用于DTSX。但是,有一个修复! SSIS允许您execute a DTS package task。构建一个DTSX软件包,将其作为唯一的任务,您将基本上运行DTS软件包。

那,或者附在2000机器上。