Running a cmd from Azure SQL

别等时光非礼了梦想. 提交于 2021-01-29 13:52:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!