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 폴더에 저장하려는 경우 @"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

적용 대상