all groups > sql server dts > july 2007 >
You're in the

sql server dts

group:

Running a package that calls another package from code



Running a package that calls another package from code CraigHB
7/6/2007 9:44:00 AM
sql server dts: I am trying to run a SSIS package (called "Parent") that calls another
package (called "Child"). The packages are stored in SQL Server (MSDB
database) and are called from a console app by the code below:


Public Shared Function RunPackage(ByVal server As String, _
ByVal userName As String, _
ByVal password As String, _
ByVal packageName As String, _
ByVal packagePassword As String) As String

Dim pkg As New Package
Dim app As New Application
Dim pkgResults As DTSExecResult
Dim result As String = ""


app.PackagePassword = packagePassword
pkg = app.LoadFromSqlServer(packageName, server, userName, password, Nothing)
pkgResults = pkg.Execute()
result = pkgResults.ToString() & vbNewLine

For Each err As DtsError In pkg.Errors
result += "Task: " & err.Source & vbNewLine
result += ParseErrorMessage(err.Description) & vbNewLine
Next

Return result

End Function


If I just run the Child package with this code, then it works! But is I run
the Parent package from the same code, then it fails with this error: "Error
0x80004002 while preparing to load the package. No such interface supported".

The only difference between the 2 packages is that the Parent calls the
Child, and the Child calls nothing.

The Connection Manager in Parent used to connect to Child uses SQL Server
Authentication and it needs to be that.

My question: From VB.NET, how do I run a SSIS package that calls another
RE: Running a package that calls another package from code Todd C
7/9/2007 12:42:03 PM
Hello Craig:
What happens if you re-design the 'Parent' to do something else, such as
just run an Execute SQL Task with "SELECT GETDATE() AS [Today]"? In other
words, NOT have it call the child package?

Do you get the same error?

--
Todd C

[quoted text, click to view]
RE: Running a package that calls another package from code CraigHB
7/10/2007 1:56:01 AM
If I do as you suggest (i.e. not have the Parent package called the Child
package), then it works.

RE: Running a package that calls another package from code CraigHB
7/16/2007 4:02:03 AM
It works now. You need to put "<MTAThread()> _" ahead of "Sub Main()" in the
AddThis Social Bookmark Button