我已经为bash编写了一个脚本,并在Windows 10上安装了bash,因此,当尝试在命令提示符下运行该脚本时,请编写以下语法:
bash -c "/home/behzad/SIP-CMD-BYE_OLT-CMD-ACT.sh 09400098129 1234 8 2
1 1 99 3 2001"
一切都很好!现在,我想在SQL Server中运行该脚本,为此,请在SQL Server中编写以下T-SQL:
EXEC master..xp_CMDShell 'bash -c "/home/behzad/SIP-CMD-BYE_OLT-CMD-ACT.sh 09400098129 1234 8 2 1 1 99 3 2001"'
但是SQL Server仅显示字符结果W
,bash脚本不起作用。我该如何解决这个问题?谢谢大家。
答案 0 :(得分:0)
尝试一下:
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO