SSIS - Getting Sequence Container Name

  • Hello Everyone

    Here is my issue:

    1.I have a Sequence Container .

    2.I have a script task in it.

    3.Is there any variable which gives me the name of the Sequence Container?

    For example, I have a sequence container by name “Copy from Catalog File”.

    In the script task, I want this name to be assigned to a variable.

    So let me know on how to get the name of the sequence container?? I have searched many system variables, but couldn’t get anything.

    Is it possible to get this name using System:ParentContainerGUID variable. I googled it, but nothing turned out to me.

    It would be a real helpful for me if someone post me a solution…!!

  • i don't think it is possible to get the name of the Container in the script task. Why don't you put the name in the variable it self and then assign it to the Sequesnce Container using Expressions.

    What is the Need to get the name of the Container into variable inside the script task.

  • You could try doing it the other way round, by setting the name of the task from the value of the variable. Just go to Expressions in the task properties and set the name there.

    John

  • Hi John/Sharath

    Thank you for your suggestion. I too was thinking the same one..

    The main need for doing this is, I'm doing logging for my package. I have divided my package into logical divisions using this sequence container. So I need to pass this container name to the log table.

    Is there any way, I can add my customized column to the inbuilt logging available in SSIS. i.e., can i add column to the table dbo.syssssislog table ??

  • Have you considered using the System::PackageName variable.

    This is a system variable and is ReadOnly.

    Raunak J

  • The System::PackageName variable gives me the name of the Package. But my requirement is to get the container name.

    For eg:, I have a script task followed by execute sql task in a Sequence container. In script task i need to set the value of Container name to a variable and pass it to the execute sql task where in it executes a sp by taking this as parameter.

  • Is there any way, I can add my customized column to the inbuilt logging available in SSIS. i.e., can i add column to the table dbo.syssssislog table ??

    I'm not familiar with that table. Did you create it yourself? If you did, then you can add columns to it. Be careful that it doesn't cause other components of your logging to fail, though.

    But my requirement is to get the container name. For eg:, I have a script task followed by execute sql task in a Sequence container. In script task i need to set the value of Container name to a variable and pass it to the execute sql task where in it executes a sp by taking this as parameter.

    I don't know how to do that. The link below might help you to get started.

    http://forums.whirlpool.net.au/archive/1062318

    John

  • 1. In your package create a variable to hold the name of your sequence container.

    2. Select your sequence container, then click the Event Handler tab, next to the Data Flow tab.

    3. Select the event that best describes when you want to assign the sequence container name to the new variable from the Event handler: drop down list and add your script task; probably the OnPreExecute event is your best bet.

    4. Add the System::SourceName system variable to the ReadOnlyVariables of the Script Task

    5. Add the User::YourVariable variable to the ReadWriteVariables of the Script Task.

    6. Add your magic to the Script.

    By throwing the event, you now have access to the Source Name in the event; it wasn't available before then. In addition, you'll have access to the description and GUID as well.

  • Paul_Blackwell (11/23/2010)


    1. In your package create a variable to hold the name of your sequence container.

    2. Select your sequence container, then click the Event Handler tab, next to the Data Flow tab.

    3. Select the event that best describes when you want to assign the sequence container name to the new variable from the Event handler: drop down list and add your script task; probably the OnPreExecute event is your best bet.

    4. Add the System::SourceName system variable to the ReadOnlyVariables of the Script Task

    5. Add the User::YourVariable variable to the ReadWriteVariables of the Script Task.

    6. Add your magic to the Script.

    By throwing the event, you now have access to the Source Name in the event; it wasn't available before then. In addition, you'll have access to the description and GUID as well.

    Just what I needed, thank you, sir!

Viewing 9 posts - 1 through 8 (of 8 total)

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