Azure SQL, SQL Server Database Monitoring, Alerts and Scheduled JobsDatabase Monitoring, Alerts and Scheduled Tasks

How to Run an Azure SQL Database Scheduled Task


One of the missing pieces of Azure SQL Database that you will find in SQL Server is the “SQL Agent”. This is a great tool to allow you to run scheduled jobs against your SQL Server database. Unfortunately, SQL Agent is not available for Azure SQL. This section will explain how to use Cotega to run stored procedures within your Azure SQL database on a scheduled interval to allow you to reproduce some of the "SQL Agent" functionality.


Getting Started

If you have not already done so, you will first need to login to the Cotega dashboard and choose "Add Monitoring Agent" for the database you wish to execute this stored procedure from. Once this is done, you should see "Execute Stored Procedure: Disabled" as shown below. Click [Edit] just to the right of this text.



A new dialog will open allowing you to choose the stored procedure you wish to schedule execution for and the time interval for which it will be executed. Once you have set these, choose "Apply" and your stored procedure will be executed on this interval.


Security User Credentials

Please ensure that the SQL user that you registered with Cotega has sufficient priviledges to execute this stored procedure.