问题
I'm trying to migrate some code from Microsoft SQL Server Management Studio to Azure SQL. The code uses xp_cmdshell
to run a .bat
file along with some parameters that moves files around and uploads said files to a git repository.
Now I have to migrate it to an Azure SQL PaaS server, where I can no longer use xp_cmdshell
- is there some workaround to this problem? Is there a way to run that .bat
file with parameters?
Thanks in advance
回答1:
Now I have to migrate it to an Azure sql PaaS server, where I can no longer use xp_cmdshell, is there some workaround to this problem? is there a way to run that .bat file with parameters?
Indeed, there is no way to get access to xp_cmdshell in PaaS offerings.
As the alternatives:
Automate workflows for a SQL database by using Azure Logic Apps
Possibly, Azure SQL Managed Insance + Python integration:
EXEC sp_execute_external_script @language = N'Python' , @script = N'your code'
来源:https://stackoverflow.com/questions/65043133/running-a-cmd-from-azure-sql