I´m using the following code to execute a SSIS package:
string pkgLocation;
Package pkg;
Microsoft.SqlServer.Dts.Runtime.Application app;
DTSExecResult pkgResults;
pkgLocation = @"C:\test\Package.dtsx";
app = new Microsoft.SqlServer.Dts.Runtime.Application();
pkg = app.LoadPackage(pkgLocation, null);
Microsoft.SqlServer.Dts.Runtime.Variable variavel = pkg.Variables["TEST"];
string sql = "SELECT DISTINCT MAX(dat_his) AS dat6_con,MAX(dat_his)-2 AS
dat4_con,MAX(dat_his)-5 AS dat1_con,MAX(dat_his)-14 AS da01_con FROM Historic
WHERE dat_his <={^2006/09/28}";
variavel.Value= sql;
pkgResults = pkg.Execute();
MessageBox.Show(pkgResults.ToString());
The execution ends without problems, and the pkgResults object receives the
value "Success". The problem is that the destination table on the existing
DataFlow Task doesn´t have any rows of data at the end of the process.
If I execute the same SSIS package in the development enviroment (SQL Server
Business Intelligence Development Studio) everything works fine, and my
destination table receives the correct data.
Does anyone have an idea of what could be the problem?
Thanks for any help.
|