SQL Server Performance

DTS Package Name

Discussion in 'SQL Server DTS-Related Questions' started by amritsandhu, Apr 25, 2007.

  1. amritsandhu New Member

    Hi, I'm trying to find a DTS package name dynamically from within the package. I can't for the life of me find out to get this property through the package. My aim is really to get the package name and write it to a table to show the package has started and completed.

    I've tried to do this through an active x script, through dynamic global variables, but I can't actually see it.

    Any ideas guys???

    Amrit
  2. satya Moderator

    Why don't take help of sysdtspackages from MSDB in this case,

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
  3. amritsandhu New Member

    ok, but then I'm still left with the same problem, how do I identify which package I need. Is there a package id property I can retrieve from within the dts package?
  4. satya Moderator

    Take help of this KBAhttp://support.microsoft.com/kb/257868 to use the code, I believe that should help as you are looking for activex type.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
  5. amritsandhu New Member

    Hi, appreciate the help, however it doesn't sort my problem, the reason being I will still need to have the package id. If I could get the package id, or package name from the existing package then I'll be onto a winner.

    Amrit
  6. satya Moderator

    Id from sysdtspackges will match to the PackageID Property, also refer to Books online on 'Retrieving DTS Information in Visual Basic' topic.

    Satya SKJ
    Microsoft SQL Server MVP
    Writer, Contributing Editor & Moderator
    http://www.SQL-Server-Performance.Com
    This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
  7. pedro.duran New Member

    Hello Amrit,

    Here is an example for getting the package name into a global variable (I created the NPackage Global Variable)


    '**********************************************************************
    ' Visual Basic ActiveX Script
    '************************************************************************
    Function Main()
    dim oPackage

    'Get package object
    set oPackage = DTSGlobalVariables.parent
    'Set the global variable with the package name
    DTSGlobalVariables("NPackage").Value = oPackage.Name

    Main = DTSTaskExecResult_Success

    set oPackage = nothing

    End Function


    Best Regards,
    Pedro Duran

Share This Page