ExecutePackageTask-PropertyID/VersionID

  • I used ExecutePackageTask in one of my DTS Package to execute another DTS package.  Recently I put a new version of the DTS package that was being executed.  The DTS package with Execute PackageTask aborted with version ID not existed.  I looked up Books Online and it said:

    "For the ExecutePackageTask object, the PackageID does not need to be specified if sufficient other information is specified to identify the package. If the VersionID is not specified, the most recent version of the package is run."

    So I went to the property and blank out the version ID and packageID of the DTSExecutePackageTask.

    The next day it ran with the old package id and old version id again. The version ID and PackageID seemed to pop up on its own.

    Does anyone know why?  Should I stay away from ExecutePackageTask?

    Thanks

     

     

     

     

     

     

  • This was removed by the editor as SPAM

  • How did you blank out the property?

    I use an activeX script task before calling the ExecutePackageTask to blank this property as below ( and it works for me for 3 years now):

    Function Main()

    Dim objPackage ' As DTS.Package2

    Dim objTask ' As DTS.Task

    Dim objPropertyID ' As DTS.Property

    ' Dim objPropertyName ' As DTS.Property

    ' Dim strPackageName ' As String

    ' Dim strPackageCalledName ' As String

    Set objPackage = DTSGlobalVariables.Parent

    ' strPackageName = objPackage.Name

    For Each objTask in objPackage.Tasks

    ' if task is ExecutePackageTask type

    If LEFT(objTask.Name, 30) = "DTSTask_DTSExecutePackageTask_" Then

    ' strTaskName = objTask.Name

    ' strDescr = objTask.Description

    Set taskprops = objTask.Properties

    ' Set objPropertyName = taskprops("PackageName")

    ' strPackageCalledName = objPropertyName

    Set objPropertyID = taskprops("PackageID")

    blnID = objPropertyID.Set

    IF blnID = True THEN

    objPropertyID.Value = "" 'set to blank

    END IF

    End If

    Next

    Main = DTSTaskExecResult_Success

    End Function

Viewing 3 posts - 1 through 2 (of 2 total)

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