How to Excecute ssis package from excel

  • I have excel vba code in excel where i would like to add code to execute ssis package from excel. please help

  • Let's first state that I find this a terrible idea, but maybe you have a valid use case.

    You can start an SSIS package either by calling dtexec.exe directly from the VBA code using the correct parameters (or by launching a bat script that does the same), or you can create a SQL Server Agent job and start the job with a stored procedure from the VBA code.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • concur on terrible idea, especially if Excel is in hands of users.

  • Why do you think this a terrible idea?

    Just wondering.

    Susan

  • SuzSQL (5/30/2014)


    Why do you think this a terrible idea?

    Just wondering.

    Susan

    This is a pretty old thread.

    Why launch an executable from within excel? Excel is not a database, is not an operating system, is not a task scheduler, etc etc etc.

    Creating a workbook to allow endusers the ability to kick off SSIS packages is an easy way to abuse the application and an easy way to get things screwed up in the database (since SSIS packages will generally have something to do with the database).

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SQLRNNR (5/30/2014)


    SuzSQL (5/30/2014)


    Why do you think this a terrible idea?

    Just wondering.

    Susan

    This is a pretty old thread.

    Why launch an executable from within excel? Excel is not a database, is not an operating system, is not a task scheduler, etc etc etc.

    Creating a workbook to allow endusers the ability to kick off SSIS packages is an easy way to abuse the application and an easy way to get things screwed up in the database (since SSIS packages will generally have something to do with the database).

    +1

    This idea has a great potential for disaster.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • SSIS pkgs weren't meant for this kind of ad hoc firing. Obviously, everything depends on your unique environment, but here, an SSIS pkg could be moving gigs or terabytes of data. Deciding when to move that data is not something I would want left to a user. We schedule pkgs to do their work at the times best for our workloads and there are pkgs dependent upon other pkgs and we need to control that else risk really bad data.

    If the pkg does cause a problem, there is a good chance that the user has no idea, just "Clicked on the button Bob made for me.... maybe an hour or two ago" I'm sure the pkg firing could be found/traced but not as easily as when it goes thru Agent.

    Further, what if User A fires the pkg at 8 am, closes the workbook and goes on with their day. User B opens workbook within the hour or nearly so, and is unaware that User A already fired the pkg, so executes it again. This is fast track to duplication, let alone unexpected, unintended resource utilization.

    Excel is an analysis tool. While it can do more, using it in this manner should only be done under very close supervision for the most trusted employees, and with DR in place. Every environment is different and there could be a very good reason why they need to do it via Excel at user option vs regular schedule.

  • My situation was not a huge data load but instead was going to load worksheets from the excel to temporary tables and perform some calcs and return. Data needed to be crunched apart from excel for privacy reasons. Could be done with stored procs but I wanted to use SSIS because everything could be done in one swoop. As it turns out the ability to launch SSIS turned problematic and I have moved to a different solution but I believe that the solution would have been fine if I could have executed the package without jumping through hoops. It would not have mattered if the user launched it a million times as it was specific to their session and would have just failed if they closed out of excel.

    thanks for the replies.

    Susan

  • SuzSQL (6/3/2014)


    My situation was not a huge data load but instead was going to load worksheets from the excel to temporary tables and perform some calcs and return. Data needed to be crunched apart from excel for privacy reasons. Could be done with stored procs but I wanted to use SSIS because everything could be done in one swoop. As it turns out the ability to launch SSIS turned problematic and I have moved to a different solution but I believe that the solution would have been fine if I could have executed the package without jumping through hoops. It would not have mattered if the user launched it a million times as it was specific to their session and would have just failed if they closed out of excel.

    thanks for the replies.

    Susan

    Out of interest, what was your alternative approach?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • We are going with the stored proc solution. click button , runs procs, returns #.

    I really wanted the ssis to work and the concept worked in VS just not the execution from remote Excel. I made other packages for the same project and hoped to keep them together. Alas back to straight SQL. 🙂

    thanks

    S

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply