Programatically running a SSIS package

Discussion in 'Microsoft Dot NET' started by Guest, Sep 29, 2006.

  1. Guest

    Guest Guest

    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.
     
    Guest, Sep 29, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Mercier

    Programatically browsing a website as a logged on user?

    Carl Mercier, Jul 26, 2003, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    203
    Carl Mercier
    Jul 26, 2003
  2. Jonathan Trevor

    How get "log on locally" users and groups programatically?

    Jonathan Trevor, Aug 22, 2003, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    178
    Jonathan Trevor
    Aug 22, 2003
  3. Sanjay Seshasainam

    How can I send Keyboard key clicks programatically.

    Sanjay Seshasainam, Sep 25, 2003, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    248
    Sanjay Seshasainam
    Sep 25, 2003
  4. JP

    Access IE favorites programatically

    JP, Oct 20, 2003, in forum: Microsoft Dot NET
    Replies:
    5
    Views:
    547
    Peter Rilling
    Oct 21, 2003
  5. asr

    How to raise events programatically?

    asr, Nov 3, 2003, in forum: Microsoft Dot NET
    Replies:
    3
    Views:
    289
    Michael Lang
    Nov 3, 2003
  6. Jonas Bergman

    Sharing folders programatically

    Jonas Bergman, Jan 2, 2004, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    139
    Jonas Bergman
    Jan 2, 2004
  7. Techeek

    SSIS Deployment

    Techeek, Jan 7, 2008, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    218
    Techeek
    Jan 7, 2008
  8. Daniel

    SSIS - string variable!

    Daniel, May 15, 2008, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    185
    Daniel
    May 15, 2008
Loading...