2013-11-26 56 views
0

我試圖在Microsoft SQL Server 2000數據庫上運行xp_cmdshell,但遇到問題。當我使用它運行命令時,它會超時,甚至像dir這樣簡單的東西。xp_cmdshell不起作用 - Microsoft SQL Server 2000

我做了以下事項以確保xp_cmdshell已啓用。

EXEC sp_configure ’show advanced options’, 1 
RECONFIGURE 
EXEC sp_configure ’xp_cmdshell’, 1 
RECONFIGURE 

當運行版EXEC sp_configure的xp_cmdshell',1我得到錯誤信息

*配置選項 '的xp_cmdshell' 不存在,也可能是一個高級選項。*

我證實通過運行EXEC sp_configure的啓用高級選項,輸出甚至沒有表現出xm_cmdshell,整個輸出爲:

affinity mask -2147483648 2147483647 0 0 
allow updates 0 1 0 0 
awe enabled 0 1 0 0 
c2 audit mode 0 1 0 0 
cost threshold for parallelism 0 32767 5 5 
Cross DB Ownership Chaining 0 1 0 0 
cursor threshold -1 2147483647 -1 -1 
default full-text language 0 2147483647 1033 1033 
default language 0 9999 0 0 
fill factor (%) 0 100 0 0 
index create memory (KB) 704 2147483647 0 0 
lightweight pooling 0 1 0 0 
locks 5000 2147483647 0 0 
max degree of parallelism 0 32 0 0 
max server memory (MB) 4 2147483647 2147483647 2147483647 
max text repl size (B) 0 2147483647 65536 65536 
max worker threads 32 32767 255 255 
media retention 0 365 0 0 
min memory per query (KB) 512 2147483647 1024 1024 
min server memory (MB) 0 2147483647 0 0 
nested triggers 0 1 1 1 
network packet size (B) 512 32767 4096 4096 
open objects 0 2147483647 0 0 
priority boost 0 1 0 0 
query governor cost limit 0 2147483647 0 0 
query wait (s) -1 2147483647 -1 -1 
recovery interval (min) 0 32767 0 0 
remote access 0 1 1 1 
remote login timeout (s) 0 2147483647 20 20 
remote proc trans 0 1 0 0 
remote query timeout (s) 0 2147483647 600 600 
scan for startup procs 0 1 0 0 
set working set size 0 1 0 0 
show advanced options 0 1 1 1 
two digit year cutoff 1753 9999 2049 2049 
user connections 0 32767 0 0 
user options 0 32767 0 0 
+0

我相當肯定這個選項不會在SQL 2000中存在的僅僅是在以後的版本推出。所以回到故障排除您的原始問題關於它超時。你能發佈超時的確切T-SQL嗎? –

回答

0

你正在做什麼是正確的。你是否單獨運行這兩個sp_configure選項,然後重新配置,而不是將整個事件作爲單個語句運行?

http://technet.microsoft.com/en-us/library/ms190693.aspx

-- 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