How do I run a long-running stored procedure on SQL Server, even if I get disconnected?

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.

sql developer

Are you using Hibernate to call this stored procedure?

Hai vlad
Yes i am using it.

sql developer

You cannot do easily because SQL Server communication is synchronous by default.

Check out this StackOverflow question and answers for some workarounds.

Hai vlad,
Thanks i will check them