I have a stored procedure in an Azure SQL Database that does not return a result and can take several hours to run. It takes one parameter, and I am running it through the query editor window in Management Studio on my local machine:

EXEC @return_value = dbo.ComputeBatchData @BatchId = 2

My problem: If I get disconnected, the procedure is cancelled.

The procedure does not need to run on a schedule or anything. I just want to run the procedure and not have to worry about disconnects.

  • 1
    Have you looked at Azure Automation yet? – vonPryz Jan 28 '17 at 11:18
  • 1
    "On an Azure server" - could you please be a bit more specific here? Answers may differ depending on whether you mean SQL Server on a Windows Azure VM (where you can use a job or service broker) or Azure SQL Database (where you can't). – Aaron Bertrand Jan 28 '17 at 12:14
  • 2
    @Nethawk please merge your 2 accounts. – ypercubeᵀᴹ Jan 28 '17 at 12:26
  • 1
    I mean an Azure Database where I can't use Service Broker functions. I found out that I couldn't use SB when I tried to implement this rusanu.com/2009/08/05/asynchronous-procedure-execution – NetHawk Jan 28 '17 at 15:06
  • you need to create a job and then schedule it – CR241 Aug 28 '18 at 23:13

Azure Automation: Schedule the Execution of SQL Jobs in Azure with Automation Service

and make a small powershell script and schedule it in the azure dashboard.

  • I've been informed that Azure Scheduler will be removed after September 2019. They suggested using Logic Apps instead. – Michael Green Nov 9 '18 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.