On our test server SQL 2005 SP2 we have enable xp_cmdshell. We use this for many purposes (deleting old files, making email attachments etc) I have seen no problems here. If I execute
xp_cmdshell 'echo hi'
On our production server (which so far I haven't found any differences to test) If I execute xp_cmdshell 'echo hi'
Likewise no other command I have tried works. I just get a NULL output. I have verified xp_cmdshell is active by executing:
exec sp_configure 'show advanced option', '1'
sp_configure 'xp_cmdshell', '1'
as well as verifying xp_cmdshell is enabled in SQL Server Surface Are for Features.
I am sure this was working a few weeks ago. Any thoughts as to why it might not be working now? I have checked the event viewer and saw nothing odd. The SQL log is odd only in that it does show up in date order. That is I see entries like:
10/27/2007 10:00:01 PM ...
10/27/2007 10:00:00 PM ....
11/4/2007 11:00:00 PM ..
11/4/2007 10:00:01 PM ....
11/3/2007 11:03:25 PM ..
But there are no messages indicating anything wrong with xp_cmdshell.
On both servers SQL was installed using Localsystem as the startup account.
I have tried on the production server creating a job where the first step is an operating system command, like echo hi and this works. If I change the job to be Transact SQL script and type xp_cmdshell 'echo hi', there is no output the same result as in SSMS.
Has anyone seen (and corrected) this kind of behaviour?