Application.SaveToDtsServer(Package, IDTSEvents, String, String) メソッド

定義

ファイル システムにパッケージを保存します。

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

適用対象