Application.SaveToDtsServer(Package, IDTSEvents, String, String) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
パッケージをファイルシステムに保存します。
public:
void SaveToDtsServer(Microsoft::SqlServer::Dts::Runtime::Package ^ pPackage, Microsoft::SqlServer::Dts::Runtime::IDTSEvents ^ pEvents, System::String ^ sPackagePath, System::String ^ sServerName);
public void SaveToDtsServer(Microsoft.SqlServer.Dts.Runtime.Package pPackage, Microsoft.SqlServer.Dts.Runtime.IDTSEvents pEvents, string sPackagePath, string sServerName);
member this.SaveToDtsServer : Microsoft.SqlServer.Dts.Runtime.Package * Microsoft.SqlServer.Dts.Runtime.IDTSEvents * string * string -> unit
Public Sub SaveToDtsServer (pPackage As Package, pEvents As IDTSEvents, sPackagePath As String, sServerName As String)
パラメーター
- pPackage
- Package
救うべきパッケージ。
- pEvents
- IDTSEvents
IDTSEvents オブジェクト。
- sPackagePath
- String
保存時にパッケージに名前を付けるためのもの。 名前の前に道筋を付けてみていいですよ。 例えば、myPackageという名前のパッケージをファイルシステムフォルダに保存する場合、パラメータは @"File System\myPackage"となります。
- sServerName
- String
パッケージを保存するサーバー名。
例
以下のコード例は、ファイルシステムフォルダにファイルが保存される myFolder2の名前を示しています。 例では、 ExistsOnDtsServer メソッドを呼び出してパッケージが保存されたかどうかを確認します。
static void Main(string[] args)
{
// The variable pkg points to the location
// of the ExecuteProcess package sample
// that is installed with the SSIS samples.
string pkg = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\ExecuteProcess Sample\ExecuteProcess\UsingExecuteProcess.dtsx";
Application app = new Application();
Package p = app.LoadPackage(pkg, null);
// Save the package under myFolder which is found under the
// File System folder on the Integration Services service.
app.SaveToDtsServer(p, null, @"File System\myFolder2", "yourserver");
// Verify that the package was saved by calling ExistsOnDtsServer.
Boolean packageExists = app.ExistsOnDtsServer(@"File System\myFolder2", "yourserver");
Console.WriteLine("Package exists? " + packageExists);
}
Shared Sub Main(ByVal args() As String)
' The variable pkg points to the location
' of the ExecuteProcess package sample
' that is 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)
' Save the package under myFolder which is found under the
' File System folder on the Integration Services service.
app.SaveToDtsServer(p, Nothing, "File System\myFolder2", "yourserver")
' Verify that the package was saved by calling ExistsOnDtsServer.
Dim packageExists As Boolean = app.ExistsOnDtsServer("File System\myFolder2","yourserver")
Console.WriteLine("Package exists? " + packageExists)
End Sub
出力例:
Package exists? True