Calling package from within another package

  • I currently have one DTS package calling another DTS package. The first one loops through directories and finds files to import. When it finds a file, it calls the second package which imports and archives the file. Each of these packages work fine independantly. And even together, I get no errors.

    The problem is, the actual transformation step in the 2nd package is simply not executing. There are no errors, the package completes as expected... only faster b/c the actual import is not taking place. The first few steps that are assigning some variables and executing a Dynamic Properties Task work fine. It just seems to quit for no apparent reason right before the actual transformation. Does anyone have any ideas what would prevent this from working?

  • Are there any locks on the files?

    You can set a setting in the package properties to log to sql server (which puts information from the steps into a table in msdb on that server).  That might give you some information.

    Russel Loski, MCSE Business Intelligence, Data Platform

  • Hi,

    What task are you using to do the transformation..?

    Cheers


    Arvind

  • Since you are calling the 2nd package to do the parsing, I assume that in some fashion you are telling the 2nd package the path to the file.  Are you sure that the 2nd package has the correct information? 

    Steve

  • There are no locks on the files that I know of. As I mentioned, the Parsing package works fine on its own if I set the parameters manually.

    The filepath is being set from the parent package as follows:

    oPKG.GlobalVariables("gv_FileName").Value=DTSGlobalVariables("gv_FileName").Value

    where oPKG is the child package.

    I used a MsgBox to see if the information was being sent to the child package correctly, and it appears that it is. However, the transformation, which is being handled by a custom Transformation task in VBScript, and the subsequent steps for some reason do not run. 

    Is there an easy way to debug the child package in runtime? If there were any errors being encountered, would I even necessary notice it if I am just wacthing the parent package execute?

     

  • Hi,

    Check the value of this Internal Variable that is provided in DTS itself

    DTSTaskExecResult_Success

    Lemme know if this helps

    Cheers,


    Arvind

  • Where/how should I check this from? What should the value be?

  • This variable is usually used to return a value from the function by assigning it to the Main Method like

    Main = DTSTaskExecResult_Success

    So the value returned by the second package in this fashion can be trapped.

    You can also use some Global Variables and assign the values in one package and check the values for the same in the parent package.

    If that doesnt workout then you can probably use something similar to what you want that is available in this link, try this...

    http://www.sqldts.com/?246

    Lemme know if this helps

    Cheers!


    Arvind

  • Sorry missed part abt value returned by DTSTaskExecResult_Success.

    This value merely indicates if the package call succeeded or failed.

    Usually its used like below:

    *************************************

    If Err.Count = 0 Then   

    Main = DTSTaskExecResult_Success

    Else

    Main = DTSTaskExecResult_Failure

    End IF

    *************************************

    Cheers!


    Arvind

  • I was able to resolve the issue - indeed, it did have to do with an error in the filepath. It didn't cause package failure, it just silently tortured me for the past day!

    Thanks for all your help.

  • Ahhh ... yes ... DTS in all it's glory.

    When I'm trying to track down a pesky problem I do the following.

    Turn on DTS package logging.

    Set each task to fail package on error, (via workflow properties).

    Set package to fail on first error.

    --------------------
    Colt 45 - the original point and click interface

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply