close
在 MS SQL Server 2005 呼叫外部程式指令,如下:
EXEC xp_cmdshell 'dir *.exe';
GO
如有錯誤:
訊息 229,層級 14,狀態 5,程序 xp_cmdshell,行 1
The EXECUTE permission was denied on the object 'xp_cmdshell', database 'mssqlsystemresource', schema 'sys'.
則須設定:
『SQL Server 介面區組態』然後點選最下面一下的『功能的介面區組態』,
然後選左手邊的『xp_cmdshell』,再勾選『啟用xp_cmdshell(E)」,
按確定即可。
全站熱搜