Copy variables between SSIS packages

If you work with SSIS you probably hit this wall many, many times: there's a package with zillion variables and you need to copy some / all of them to another package.

There is no copy-paste thingy in the UI for a variable so that's a dead end.

You can try to circumvent the problem by using project level parameters but that opens a separate can of worms. In the worst case scenario you will end up running a couple of packages in parallel, each overwriting some shared parameter's value. Or something like that.

Copy-paste for SSIS variables would be really desirable, right? Like, let's say, you're debugging a badly performing part of a package and you need to re-create some of its variables in a copy. There are various scenarios where you might need to do so. And how about copying SSIS vars between projects? And so on, and so forth.

So... is there a magic wand?

There is! And it is surprisingly simple (though not immediately obvious to everyone). Just open the SSIS package in the "View Code" mode (available in the right-click menu in the Solution Explorer pane) then scroll through the XML spaghetti until you find the "Variables" node, then simply copy some/all variables (each will have its own "Variable" node), finally paste them into the same "Variables" node of the target package, save and Bob's your uncle!

You are very welcome.

Leave a Comment

Komentarze mile widziane.

Jeżeli chcesz do komentarza wstawić kod, użyj składni:
tutaj wstaw swój kod

Jeżeli zrobisz literówkę lub zmienisz zdanie, możesz edytować komentarz po jego zatwierdzeniu.