Answered 'xp_cmdshell' does not exist??

  • Wednesday, February 25, 2009 7:12 AM
     
     
      Hi to All!

    I have two sql server 2008 instances. one is default and the other one is named.

    I executed a backup query on the named instance, it worked just fine! but when i executed the same query on the default instance it gave me a error. So i tried to run the piece of code where the error was generated on a separate query. And i got this error;

    EXEC sp_configure 'xp_cmdshell',1
    GO
    RECONFIGURE
    GO

    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
    The configuration option 'xp_cmdshell' does not exist, or it may be an advanced option.

    it is the same error that the default server gave me..

    What could be the problem?? its running prety gud in the named instance.

    Regards,
    N_SQL

Answers

  • Wednesday, February 25, 2009 10:19 AM
     
     Answered Has Code
    Hi

    In order to configure xp_cmdshell, first need to enable the advanced options and then only all the advanced configuration options works out.

    It can be done as follows:


    EXEC sp_configure 'show advanced options', 1;
    GO
    RECONFIGURE;
    GO

    EXEC sp_configure 'xp_cmdshell',1
    GO
    RECONFIGURE
    GO

    Refer http://msdn.microsoft.com/en-us/library/ms189631.aspx for more options.

    Thanks
    Sreekar
    • Marked As Answer by N_SQL Wednesday, February 25, 2009 10:53 AM
    •  

All Replies

  • Wednesday, February 25, 2009 8:06 AM
     
     
    Dear N_SQL

    Please check Surface area configuration<Database Engine>,it is enabled.
    Thanks & Regards SNIVAS
  • Wednesday, February 25, 2009 8:56 AM
     
     
    And how will do that??

    sorry for being so dumb!
  • Wednesday, February 25, 2009 10:03 AM
     
     Proposed Answer
    from this link i found where the surface area configuration is in sql server 2008..

    http://www.mssqltips.com/tip.asp?tip=1673 

    and then mark "XPCmdShellEnabled" to true.

    but still got the same error msg.. :(

    • Proposed As Answer by Varinder Sandhu Tuesday, December 21, 2010 7:41 AM
    •  
  • Wednesday, February 25, 2009 10:19 AM
     
     Answered Has Code
    Hi

    In order to configure xp_cmdshell, first need to enable the advanced options and then only all the advanced configuration options works out.

    It can be done as follows:


    EXEC sp_configure 'show advanced options', 1;
    GO
    RECONFIGURE;
    GO

    EXEC sp_configure 'xp_cmdshell',1
    GO
    RECONFIGURE
    GO

    Refer http://msdn.microsoft.com/en-us/library/ms189631.aspx for more options.

    Thanks
    Sreekar
    • Marked As Answer by N_SQL Wednesday, February 25, 2009 10:53 AM
    •  
  • Wednesday, February 25, 2009 10:29 AM
     
     
    Thank You so much it worked :)

    opening the link you refered. But it my internet speed is really slow 2day so it is taking too much time..

    Can u tell me what dz this code (that u provided) just did??
  • Wednesday, February 25, 2009 12:30 PM
     
     
    Hi

    There are certain server side configuration options  available which are also known as advanced options. xp_cmdshell is also one of those options.

    In order to reconfigure any of these advanced options, first we need to enable show advanced options(set its value to 1). Once this value is set to 1 then only we can able to set the server side configuration options

    Thanks
    Sreekar
  • Tuesday, December 21, 2010 7:37 AM
     
     

    Hi,

     

    Using SQL 2008 (not R2)

    When tried to enable advance option it works after that when run

     

    -- To update the currently configured value for advanced options.
    RECONFIGURE
    GO

    then it gives

    Msg 5808, Level 16, State 1, Line 1
    Ad hoc update to system catalogs is not supported.

     

    after that when i run

    Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
    The configuration option 'xp_cmdshell' does not exist, or it may be an advanced option.

     

    Please advice

     

    Thanks!!!


    Varinder Sandhu http://varindersandhus.blogspot.com/
  • Tuesday, December 21, 2010 7:42 AM
     
     Proposed Answer

    Hi

    http://www.mssqltips.com/tip.asp?tip=1673 

    and then mark "XPCmdShellEnabled" to true.

     

    it worked 

    thanks


    Varinder Sandhu http://varindersandhus.blogspot.com/
    • Proposed As Answer by Varinder Sandhu Tuesday, December 21, 2010 7:42 AM
    •