SSIS - How to Copy Variables From a SSIS Package to Another SSIS Package

Scenario: 

As we know that we can copy Connection Managers, Tasks and Transformations between SSIS Packages but how would we copy the variables from a SSIS Package to another SSIS Package. This can save us time while development in cases where we need to create variables with same name and data types.

Solution:

We can not click on Variable/s to copy and then go to second SSIS Package and paste it. I have created two SSIS Packages Package1 and Package2. The Package1 has two variables as shown Variable1 and Variable2 as shown below

Fig 1: Variables in SSIS Package1

To copy variables we have to go to the SSIS Package code and then copy the required variable code and paste in Package2 xml file. Before you copy and paste the variable from the code, make sure you have saved the copy of your SSIS Packages in case you mess up with SSIS Package code;)

Right Click on Package1 and Click on View Code and then copy the part as shown below
Fig 2: Package1 View Code 

Copy the code as shown below
Fig 3: Copy Variables code from Package1


Go to Package2. Right click and then Click on View Code and then paste the code we have copied in above step as shown below
Fig 4: Paste Variable's code in Package2

Save the file by using Ctrl+S or by using Save button. Once the file is saved, we will see that two variables are created in Package2 as shown below
Fig 5: Variables copied to Package2


5 comments:

  1. What about GUIDs that get copied as well?

    ReplyDelete
  2. When cleaning the glass scanner use a cleaning liquid that is anti-static. best copier

    ReplyDelete
  3. There was a desire to study at the university so that studies would not bother me as much as at school, and for this, I was advised an excellent site https://bestessaytyper.com/buy-college-essays-online on which they quickly and efficiently do write work

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Balancing work and studies is a challenge, but I'm determined to make it work. I've found a great tool to help – StoryboardThat. It lets me make a poster online, simplifying complex subjects for better understanding. Visualizing concepts through storyboards really boosts my learning. If you're in a similar situation, check out how to make a poster here: https://www.storyboardthat.com/create/poster-templates. It's been a game-changer for me in mastering the program and creating engaging study materials. Highly recommend it!




    ReplyDelete