Can anyone please advice how to access/read system variables in Script Component (e.g I want to package name from this variable System::PackageName in Script Component)
In the Script Task Editor, provide the variable names you want to access (for example System::PackageName) in the ReadOnlyVariables field.
From the script, in the C# example, use this:
public void Main()
    {
        bool fireAgain = true;
        // Read the variable
        String PackageName = (String)Dts.Variables["System::PackageName"].Value;
        // Post the value to progress results
        Dts.Events.FireInformation(3, "Package name:", PackageName, "", 0, ref fireAgain);
        Dts.TaskResult = (int)ScriptResults.Success;
    }
The results:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With