Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run script remotely on an Azure database without reliance on network reliability

I am connecting to and running queries on an Azure database (S4) which I connect to through SQL Server Management studio on my Windows 10 laptop. I have a complicated query I am running that gives me an select output after about 5 hours but since the database is so large any network problem causes me to get a transport error and lose any output I would have gotten.

if this happened with an on-premises database I would simply put the query in a SQL Server Agent job. But when connecting to an azure database instance I don't see any sql server agent in the Azure instance for me to add a query to.

I would like to be able to run a long running query remotely on a SQL Server Azure database without being dependent on stable network connection

like image 979
choba78 Avatar asked Dec 12 '25 14:12

choba78


2 Answers

Put those queries on a stored procedure and then use Azure Automation to schedule the execution of the stored procedure. In this StackOverflow thread I show step-by-step how to schedule execution of a stored procedure on Azure SQL Database using Azure Automation.

like image 139
Alberto Morillo Avatar answered Dec 15 '25 03:12

Alberto Morillo


Also an Azure VM jump box in the same region as your database is commonly used for stuff like this.

like image 44
David Browne - Microsoft Avatar answered Dec 15 '25 05:12

David Browne - Microsoft



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!