none
How to create a scheduled task for SQL? RRS feed

  • Question

  • Hi everyone,

    I have a Azure SQL Database & I need to clean up some of the tables Every-time my DB exceeds limit (lets say 5GB).

    I need my cleanup script to run on a schedule (say once every 24  hours) which will do the task automatically for me.

    How am i suppose to do this?

    Thanks

     

    Tuesday, June 10, 2014 10:32 AM

Answers

  • Hi Threedor - the Azure Automation Service provides a very powerful and flexible PowerShell execution framework (with a scheduler) that will enable you to perform the tasks described above (and many, many more) - no need to setup up and monitor a VM.  The Azure Automation is integrated in the Azure Management portal and pre-populated with the Azure PowerShell cmdlets, you can sign-up for the preview service here.
    Tuesday, June 10, 2014 2:32 PM

All replies

  • SQL Azure doesn’t support running SQL Server Agent in the cloud. If you need SQL Server Agent type functionality for SQL Azure, you can use a Windows Azure worker role and some custom code.

    Please refer the below links 

    http://blogs.msdn.com/b/sqlazure/archive/2010/07/30/10044271.aspx

    http://blogs.msdn.com/b/sqlazure/archive/2010/08/03/10045404.aspx


    • Edited by Vanchan Tuesday, June 10, 2014 10:59 AM
    Tuesday, June 10, 2014 10:57 AM
  • Hi Threedor - the Azure Automation Service provides a very powerful and flexible PowerShell execution framework (with a scheduler) that will enable you to perform the tasks described above (and many, many more) - no need to setup up and monitor a VM.  The Azure Automation is integrated in the Azure Management portal and pre-populated with the Azure PowerShell cmdlets, you can sign-up for the preview service here.
    Tuesday, June 10, 2014 2:32 PM
  • Hi Threedor - motivated by your post, I wrote a blog and corresponding PowerShell runbook that addresses your specific scenario, please check out the article here.  Your feedback would be greatly welcome.


    Friday, June 27, 2014 2:29 PM