다음을 통해 공유


Application.SaveToDtsServer Method

Saves a package to the file system.

네임스페이스: Microsoft.SqlServer.Dts.Runtime
어셈블리: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

구문

‘선언
Public Sub SaveToDtsServer ( _
    pPackage As Package, _
    pEvents As IDTSEvents, _
    sPackagePath As String, _
    sServerName As String _
)
public void SaveToDtsServer (
    Package pPackage,
    IDTSEvents pEvents,
    string sPackagePath,
    string sServerName
)
public:
void SaveToDtsServer (
    Package^ pPackage, 
    IDTSEvents^ pEvents, 
    String^ sPackagePath, 
    String^ sServerName
)
public void SaveToDtsServer (
    Package pPackage, 
    IDTSEvents pEvents, 
    String sPackagePath, 
    String sServerName
)
public function SaveToDtsServer (
    pPackage : Package, 
    pEvents : IDTSEvents, 
    sPackagePath : String, 
    sServerName : String
)

매개 변수

  • pPackage
    The package to save.
  • sPackagePath
    The name to give the package when saved. You can preface the name with a path. For example, to save a package with the name myPackage to the File System folder, the parameter would be @"File System\myPackage".
  • sServerName
    The name of the server to save the package to.

The following code example shows a package being saved to the File System folder, with a name of myFolder2. The example then checks if the package was saved by calling the ExistsOnDtsServer method.

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\90\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\90\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

Sample Output:

Package exists? True

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Application Class
Application Members
Microsoft.SqlServer.Dts.Runtime Namespace