When deploying an SSIS package on the test server I started to get an error " Data flow task error failed validation and return validation status "VS_NEEDSNEWMETADATA" " I tried to run the SSIS from VS, against the test database and realized I could reproduce the error. I soon realized that the DB I was running against had indeed a different metadata than the local database. For once, there was something useful in SSIS error messages. Fixing it fixed the error.
Friday, March 17, 2017
Tuesday, March 14, 2017
SSIS and VS 2013: using variables in the Script Task
While trying to use a Project Level Connection Managers in the new SSIS 2016, I realized we need a way to use the connection strings in the package, but didn't have access to them. So I put the Connection Strings into the variables and reuse this further on in the package.
In order to do this, I created two variables (in fact they were created before, this was a migration to SSIS 2016), I created a script task at the beginning of the package, select the variables that I want to set as ReadWriteVariables,
edit the script and set , in the main function:
Dts.Variables["myVariable1"].Value = Dts.Connections["myConnectionManager1"].ConnectionString;Dts.Variables["myVariable2"].Value = Dts.Connections["myConnectionManager2"].ConnectionString;
That's it!
Posted by Radu at 8:19 AM 0 comments
Subscribe to:
Posts (Atom)