How SQL Server enables the xp_cmdshell component

Source: Internet
Author: User

"Error description":

SQL Server blocked access to the process ' Sys.xp_cmdshell ' of the component ' xp_cmdshell '. Because this component has been shut down as part of this service's security configuration. System administrators can enable ' xp_cmdshell ' by using sp_configure. For more information about enabling ' xp_cmdshell ', see the SQL Help file.

"Cause analysis":
xp_cmdshell allows the system administrator to execute a given command string as an operating system command-line interpreter and return any output as a text line, which is a very powerful extended storage process. In general, xp_cmdshell is also unnecessary for administrators, and the removal of xp_cmdshell does not have any impact on the server.
"Workaround":
1. Open with SQL statement. [This method is recommended because it is available in any version of SQL Server.] ]
Through Query Analyzer, select the master database and execute the following SQL content:
' Show advanced Options ',1reconfigurego'xp_cmdshell',1  reconfigurego

Execution Result:

Configuration options ' show advanced options ' has changed from 0 to 1. Please run the RECONFIGURE statement to install.
Configuration option ' xp_cmdshell ' has changed from 0 to 1. Please run the RECONFIGURE statement to install.

To close, simply change "sp_configure ' xp_cmdshell ', 1" to "sp_configure ' xp_cmdshell ', 0".

If you see this text, you are using RSS to read or turn to "a Tree-blog park," The original address: http://www.cnblogs.com/atree/p/SQL_SERVER_xp_cmdshell.html

2. Open with SQL Server Surface area configurator. [If it's difficult to write code, use this method.] ]

Locate the start-to-SQL installation directory--Configure the SQL Server Managerment surface Area configuration.


After opening. Locate and tap the feature's surface area configurator.

Click on the bottom xp_cmdshell in the window that opens and click Enable on the right.

After opening, find "xp_cmdshell" click Enable. With the tablets from SQL SERVER 2005, other versions of the SQL interface may be different, please look for them according to your own version.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.