Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Application.SaveToDtsServer Method

Saves a package to the file system.

Namespace:  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

'Declaration
Public Sub SaveToDtsServer ( _
	pPackage As Package, _
	pEvents As IDTSEvents, _
	sPackagePath As String, _
	sServerName As String _
)
'Usage
Dim instance As Application
Dim pPackage As Package
Dim pEvents As IDTSEvents
Dim sPackagePath As String
Dim sServerName As String

instance.SaveToDtsServer(pPackage, pEvents, _
	sPackagePath, sServerName)

Parameters

pPackage
Type: Microsoft.SqlServer.Dts.Runtime.Package
The package to save.
pEvents
Type: Microsoft.SqlServer.Dts.Runtime.IDTSEvents
An IDTSEvents object.
sPackagePath
Type: System.String
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
Type: System.String
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.

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

Sample Output:

Package exists? True

Community Additions

ADD
Show:
© 2015 Microsoft