Upgrade 메서드
Upgrades one or more Integration Services packages from a specified source location to a specified destination location.
네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS.dll의 Microsoft.SqlServer.ManagedDTS
구문
‘선언
Public Function Upgrade ( _
packages As IEnumerable(Of UpgradePackageInfo), _
source As StorageInfo, _
destination As StorageInfo, _
options As BatchUpgradeOptions, _
events As IDTSEvents _
) As UpgradeResult
‘사용 방법
Dim instance As Application
Dim packages As IEnumerable(Of UpgradePackageInfo)
Dim source As StorageInfo
Dim destination As StorageInfo
Dim options As BatchUpgradeOptions
Dim events As IDTSEvents
Dim returnValue As UpgradeResult
returnValue = instance.Upgrade(packages, _
source, destination, options, events)
public UpgradeResult Upgrade(
IEnumerable<UpgradePackageInfo> packages,
StorageInfo source,
StorageInfo destination,
BatchUpgradeOptions options,
IDTSEvents events
)
public:
UpgradeResult^ Upgrade(
IEnumerable<UpgradePackageInfo^>^ packages,
StorageInfo^ source,
StorageInfo^ destination,
BatchUpgradeOptions^ options,
IDTSEvents^ events
)
member Upgrade :
packages:IEnumerable<UpgradePackageInfo> *
source:StorageInfo *
destination:StorageInfo *
options:BatchUpgradeOptions *
events:IDTSEvents -> UpgradeResult
public function Upgrade(
packages : IEnumerable<UpgradePackageInfo>,
source : StorageInfo,
destination : StorageInfo,
options : BatchUpgradeOptions,
events : IDTSEvents
) : UpgradeResult
매개 변수
- packages
형식: System.Collections.Generic. . :: . .IEnumerable< (Of < ( <'UpgradePackageInfo> ) > ) >
The collection of packages to be upgraded.
- source
형식: Microsoft.SqlServer.Dts.Runtime. . :: . .StorageInfo
An StorageInfo object that specifies the source location for the packages to be upgraded.
- destination
형식: Microsoft.SqlServer.Dts.Runtime. . :: . .StorageInfo
The StorageInfo object that specifies the destination location for the packages to be upgraded.
- options
형식: Microsoft.SqlServer.Dts.Runtime. . :: . .BatchUpgradeOptions
A BatchUpgradeOptions object that specifies the options that will be applied to the packages during the upgrade process.
- events
형식: Microsoft.SqlServer.Dts.Runtime. . :: . .IDTSEvents
An IDTSEvents object.
반환 값
형식: Microsoft.SqlServer.Dts.Runtime. . :: . .UpgradeResult
An UpgradeResult object that specifies the result of upgrading one or more packages.
예제
The following example shows how to upgrade a collection of packages. The original packages and the upgrade packages are stored in a folder in the file system.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
UpgradePackageInfo packinfo1 = new UpgradePackageInfo("C:\\temp\\Package.dtsx", "C:\\temp\\Package.dtsx", null);
UpgradePackageInfo packinfo2 = new UpgradePackageInfo("C:\\temp\\Package2.dtsx", "C:\\temp\\Package2.dtsx", null);
Collection<UpgradePackageInfo> packages = new Collection<UpgradePackageInfo>();
packages.Add(packinfo1);
packages.Add(packinfo2);
StorageInfo storeinfoSource = StorageInfo.NewFileStorage();
storeinfoSource.RootFolder = "C:\\temp";
StorageInfo storeinfoDest = StorageInfo.NewFileStorage();
BatchUpgradeOptions upgradeOpts = new BatchUpgradeOptions();
upgradeOpts.Validate = true;
upgradeOpts.BackupOldPackages = true;
upgradeOpts.ContinueOnError = true;
upgradeOpts.ValidationFailureAsError = true;
MyEventsClass eventsClass = new MyEventsClass();
app.Upgrade(packages, storeinfoSource, storeinfoDest, upgradeOpts, eventsClass);
}
}
class MyEventsClass : DefaultEvents
{
public override void OnPreExecute(Executable exec, ref bool fireAgain)
{
Console.WriteLine("The PreExecute event of the " + exec.ToString() + " has been raised.");
Console.Read();
}
}
}