Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to keep duplicate records when running a SSIS package from a C# solution

I have a SSIS package that is run from a C# solution. When I run the package directly, any duplicate records are saved to a SQL table (All records), however when I run the same package from a C# solution, the duplicate rows are excluded and only records with unique IDs are stored to the SQL table. Any help or suggestions would be greatly appreciated.

Code from comments section below:

string pkgLocation = p; 
Package pkg; 
DTSExecResult pkgResults; 
Variables vars; 
Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
MyEventListener eventListener = new MyEventListener();
pkg = app.LoadPackage(pkgLocation, eventListener); 
pkg.DelayValidation = true; 
vars = pkg.Variables; 
vars["User::Environment"].Value = "DEV";
pkgResults = pkg.Execute(null, vars, eventListener, null, null);

Comments