How schedule a SQL Query to run every day on Azure?

Sinais 25 Reputation points
2023-01-29T22:46:40.13+00:00

Hello.

I'm using the Azure services and I have a query stored as a procedure in SQL Server. I would like to run this procedure automatically everyday. What would be the best approach to achieve that with Azure services?

Thanks in advance.

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. Nitish Sharma 441 Reputation points
    2023-01-29T23:03:30.7033333+00:00

    The best approach to run a SQL Server stored procedure automatically every day in Azure is to use Azure Automation and runbooks. You can create a runbook with a SQL script that will execute the stored procedure. Then you can create a schedule for the runbook to run daily.

    Alternatively, you can use Azure Functions with a Timer Trigger to execute the stored procedure daily. You can write an Azure Function in your preferred language (C#, Java, Python, etc.) that executes the stored procedure and configure the Timer Trigger to run daily. You can also use Azure Logic Apps to achieve this.

    3 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2023-01-29T23:28:53.6833333+00:00

    Adding to the answer provided by Nitish, here you will find a step-by-step procedure to automate execution of a T-SQL stored procedure using Azure Automation.

    3 people found this answer helpful.
    0 comments No comments

  2. JORGE NICOLAS CATALAN LAGOS 0 Reputation points
    2023-10-19T14:38:19.14+00:00

    You can also use a pipeline with the activity "Storage Procedure", then you can just schedule that pipeline for your needs. (On Azure Data Factory)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.