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
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.
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?
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.
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
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.
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