如何啓用 xp_cmdshell
爲什麼它阻止或禁止?*master..xp_cmdshell是SQL Server上blockes
回答
同時使您需要查看的
的允許部分xp_cmdshell的MSDN文檔: 請按照鏈接
https://msdn.microsoft.com/en-us/library/ms190693.aspx
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO
1.儘量不要複製內容。 2.(如果你做1)你應該明確說明你已經複製了內容的來源。 – TheLostMind
是啊,自己開始我貼了xp_cmdshell MSDN文檔:... @ TheLostMind – Chanukya
@Chanukya:看[如何引用材料](https://stackoverflow.com/help/referencing);缺少的是一個鏈接。 –
xp_cmdshell-將給定的命令字符串或批處理文件作爲操作系統命令shell執行,並將任何輸出作爲文本行返回。
權限/版權:只有SysAdmin固定角色才能執行它。
語法
xp_cmdshell的{「command_string「} [,no_output] 參數
‘command_string’
是對命令串在操作系統命令殼或從DOS提示符執行。 command_string是varchar(255)或nvarchar(4000),沒有默認值。
command_string不能包含多個雙引號集。
如果command_string引用的文件路徑或程序名中存在任何空格,則需要一對引號。
如果您在嵌入式空間時遇到問題,請考慮使用FAT 8.3文件名作爲解決方法。
no_output
是可選參數executi
- 允許高級選項進行更改。 EXEC sp_configure'顯示高級選項',1 GO - 更新高級選項的當前配置值。 RECONFIGURE GO - 禁用xp_cmdshell的選項現在 版EXEC sp_configure的xp_cmdshell',0 GO RECONFIGURE GO
更多的Info-- http://yrushka.com/index.php/sql-server/security/execute-remotely-t-sql-command-through-xp_cmdshell/
Use Master
GO
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
GO
- 1. exec master..xp_cmdshell bcp select
- 2. SQL Server 2005中的xp_cmdshell
- 3. SQL Server的xp_cmdshell的錯誤5
- 4. xp_cmdshell不起作用 - Microsoft SQL Server 2000
- 5. SQL Server:爲什麼默認禁用xp_cmdshell?
- 6. exec master..xp_cmdshell @CMD for sybase ase access denied
- 7. 命令「EXEC master..xp_cmdshell」不創建文件
- 8. SQL Server Linux公共預覽版上的xp_cmdshell
- 9. 可以在一組數據上使用EXEC master..xp_cmdshell嗎?
- 10. 在SQL Server中使用xp_cmdshell通常是不好的做法嗎?
- 11. 使用xp_cmdshell的T-SQL FTP
- 12. xp_cmdshell本機錯誤208,SQL Server 2008 R2中的BCP
- 13. SQL Server 2014:具有存儲過程的FileTable觸發器w/xp_cmdshell
- 14. 將SQL Server 2008 R2表格的內容導出爲CSV無xp_cmdshell
- 15. 在SQL Server中使用xp_cmdshell的複製項目
- 16. SQL Server 2008運行Procs:如何獲取xp_cmdshell項目?
- 17. 使用xp_cmdshell調用的SSIS包是否可以在SQL Server事務中登記?
- 18. 從XP_CMDSHELL
- 19. 啓用「xp_cmdshell的」 SQL服務器
- 20. 使用puppet在windows server 2008上安裝tomcat 7(master是ubuntu)
- 21. bcp輸出到master..XP_cmdshell存儲過程從excel執行時不工作
- 22. SQL服務器被xp_cmdshell一起
- 23. Inedo Build Master vs Team Foundation Server
- 24. 替代xp_cmdshell的
- 25. 是否有可能從SQL服務器上傳ftp文件而不使用xp_cmdshell?
- 26. 上在SQL Server
- 27. 可用磁盤空間是否存儲在sql server(2000)master數據庫中?
- 28. 在master-master/multi-master複製中,誰是次要的?
- 29. 需要哪些權限查詢SQL Server中master..syslogins中?
- 30. SQL Server - 新用戶有權訪問master數據庫
大多數DBA的誰知道他們在做什麼贏得不啓用xp_cmdshell;實際上它可能會被棄用! –
你想用它做什麼?通常有更安全的替代品 – MartW
先生,我想要在觸發器中運行.exe文件。 –