从Azure SQL运行cmd [英] Running a cmd from Azure SQL

查看:56
本文介绍了从Azure SQL运行cmd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一些代码从Microsoft SQL Server Management Studio迁移到Azure SQL.该代码使用 xp_cmdshell 来运行 .bat 文件以及一些用于移动文件并将其上传到git存储库的参数.

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.

现在,我必须将其迁移到Azure SQL PaaS服务器,在该服务器上我不再可以使用 xp_cmdshell -此问题是否有解决方法?有没有一种方法可以使用参数运行该 .bat 文件?

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?

预先感谢

推荐答案

现在,我必须将其迁移到Azure sql PaaS 服务器,在该服务器上我无法不再使用xp_cmdshell,是否有解决此问题的方法?是有没有一种方法可以运行带有参数的.bat文件?

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?

实际上,在PaaS产品中无法访问xp_cmdshell.

Indeed, there is no way to get access to xp_cmdshell in PaaS offerings.

作为替代方案:

可能是Azure SQL管理的实例+ Python集成:

Possibly, Azure SQL Managed Insance + Python integration:

EXEC sp_execute_external_script @language = N'Python' , @script = N'your code'

这篇关于从Azure SQL运行cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆