I created an SSIS package (in VS 2013) with a data flow task containing several script components. I needed to add another data flow task that is similar to the existing one so I copied and pasted it into the package and added a precedence constraint so that the new one runs after the old one. I changed the code in the script components in the new data flow task according to business requirements and ran the package. I soon realized that when the new data flow task runs, the script components from the old data flow were being executed. Weird.
After some internet searching, I found this page:
http://kohera.be/blog/sql-server/the-dangers-of-copying-script-components-in-ssis/
which describes how the copying of the data flow task doesn't change the assembly name or root namespace in any script component in the new data flow. Apparently, at runtime the assembly of the new script is overwritten by that of the old script. The web page says the problem can be fixed by copying the script component to another package and then copying it back to the original package. Presumably that will change the assembly name of each script component. I'm glad it worked for him but it didn't work for me.
I also tried changing the assembly name in the script editor here:
Application properties
But that didn't work either. The code in the old script component still runs in the new data flow. I'm guessing the root namespace needs to change but that's greyed out so I can't manually change it. So I'm still looking for a solution that doesn't involve recreating the script components from scratch since they contain multiple outputs with many columns in each. Hoping you might have an answer.
In SQL Server Data Tools (SSDT), open the Integration Services project that contains the package that you want to copy. In Solution Explorer, double-click the package. On the File menu, click Save <package name> As. The package must be opened in SSIS Designer before the Save As option appears on the File menu.
I have been curious about your question because I have had this happen to me in the past and I corrected by simply recreating the script component and copying relevant code. Obviously less than idea but.....
anyway, I confirmed by looking at the dtsx package in notepad (note it is just xml) that the issue with copying is the application/namespace remains the same so when compiled one just overwrites the other.
I found a good blog on a way to do it in a Sript Task
(http://agilebi.com/jwelch/2008/04/30/renaming-the-script-project-in-ssis-2008/) but the same solution doesn't look like it is available in a Script Component
because the later does not have expressions available to it for use.....
Script Component Method - Successfully Tested
However, I did just recreated the problem and discovered a solution. Thought admittedly I am not sure if my solution would be easier than recreating the script component and copying in the script. Anyway, a DTSX is an XML file so you can edit it directly! In my case and likely standard there was 10 locations that I had to change the values. So
Create a backup copy of your package just in case!
Script Task Method - Successfully Tested
And the easy method if you are discussing a Script task
in the Control Flow.
properties
of Script task
and choose Expressions
ScriptProjectName
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