locked
How can we execute a task or container for every 30 minutes in ssis . RRS feed

  • Question

  • Can any body help..

    How can we execute a task or container for every 30 minutes in ssis .


    sunny
    Thursday, June 30, 2011 5:43 AM

Answers

  • you can use script task before conatainer to make package to sleep for a time

    use this VB .net  code in script task

    System.Threading.Thread.Sleep( time )

     

    or use alternative explained in Jamie's blog

    http://consultingblogs.emc.com/jamiethomson/archive/2006/10/23/SSIS_3A00_-Put-a-package-to-sleep.aspx

     

    this will make your package to stop for given time only when package will execute.


    Cheers, Shailesh
    • Proposed as answer by latha521 Thursday, June 30, 2011 1:59 PM
    • Marked as answer by Jerry Nee Monday, July 11, 2011 12:50 AM
    Thursday, June 30, 2011 1:09 PM
  • ZOMG - do NOT use the For Loop Container "delay technique"  It'll just waste CPU cycles.  Use the Script.
    Todd McDermid's Blog Talk to me now on
    • Marked as answer by Jerry Nee Monday, July 11, 2011 12:50 AM
    Thursday, June 30, 2011 3:18 PM

All replies

  • You can create a separate package for the task which you want to execute in every 30 minutes and then schedule that package with SQL Job Agent to run in every 30 mintues.

     

     

     


    Cheers, Shailesh
    Thursday, June 30, 2011 6:12 AM
  • a Task or Container stand alone - no

    create a SSIS Package whith the Task or Containe rin and then create a Job in SQL Serverwith a schedule  to start the package every 30 Minutes

    Thursday, June 30, 2011 6:15 AM
  • Thanks for the suggetions..Is there any mechanism to delay in executing a container..For example,i want to execute the final dataflow task ,after waiting for 30mins..
    sunny
    Thursday, June 30, 2011 12:37 PM
  • Use for Loop Container before your DF task 

    In EvalExpression give this below expression to wait for 30 minutes.

    DATEADD( "minute",30, @[System::ContainerStartTime]  ) >  GETDATE() 

    Thursday, June 30, 2011 1:02 PM
  • you can use script task before conatainer to make package to sleep for a time

    use this VB .net  code in script task

    System.Threading.Thread.Sleep( time )

     

    or use alternative explained in Jamie's blog

    http://consultingblogs.emc.com/jamiethomson/archive/2006/10/23/SSIS_3A00_-Put-a-package-to-sleep.aspx

     

    this will make your package to stop for given time only when package will execute.


    Cheers, Shailesh
    • Proposed as answer by latha521 Thursday, June 30, 2011 1:59 PM
    • Marked as answer by Jerry Nee Monday, July 11, 2011 12:50 AM
    Thursday, June 30, 2011 1:09 PM
  • ZOMG - do NOT use the For Loop Container "delay technique"  It'll just waste CPU cycles.  Use the Script.
    Todd McDermid's Blog Talk to me now on
    • Marked as answer by Jerry Nee Monday, July 11, 2011 12:50 AM
    Thursday, June 30, 2011 3:18 PM
  • If you already have a OLE DB connection, for instance, than in my opinion the easiest way to execute something over and over again (maybe waiting for a file to appear on a FTP server or a certain value in a database to change) is to set it up inside a For Loop Container and add an Execute SQL Task as the first step. You then choose the OLE DB connection as Connection in the Execute SQL Task and add the following SQL code in SQLStatement: WAITFOR DELAY '00:01' (this stops the package for 1 minute and then goes on). Then you just to fix your logic in the For Loop Container to match your needs, for example you may want it to run only a certain amount of times or only between certain times of the day, and so on. But that's just For Loop Container settings. 
    Friday, March 18, 2016 8:15 AM