468,242 Members | 1,626 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

Programatically running a SSIS package

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();
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.

Sep 29 '06 #1
0 1557

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by =?Utf-8?B?RGF2aWQgTG96emk=?= | last post: by
2 posts views Thread by pvong | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.