In this sql server tutorial, we will discuss how to fix the error message “Msg 15123: The configuration option ‘xp_cmdshell’ does not exist, or it may be an advanced option.“
sql the configuration option ‘xp_cmdshell’ does not exist or it may be an advanced option
Recently, when I was working with SQL Server 2019, I faced this error. I was trying to create a folder in the local file system with the help of SQL Server. I was trying to use the xp_cmdshell system-defined stored procedure.
I found that as a security configuration, the xp_cmdshell is turned off by default and we have to turn it on to use it. When I tried to turn it ON, I faced the following error:
USE master GO sp_configure 'xp_cmdshell', '1' RECONFIGURE GO
The problem was that the xp_cmdshell is an advanced option. If we want to use this option, we need to enable the Show Advanced Options. After understanding the problem I wrote the following SQL code to turn on the Show Advanced Options and the xp_cmdshell option.
USE master GO sp_configure 'show advanced options', '1' RECONFIGURE GO sp_configure 'xp_cmdshell', '1' RECONFIGURE GO
After executing the above query I did not face this error. Also, I was able to create the folder in the local file system using this xp_cmdshell.
You may also like the following SQL server tutorials:
- SQL Server stored procedure return value
- SQL Server drop table if exists
- SQL Server convert integer to string
- Exception Handling in SQL Server
- Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements
- Error: 40 – could not open a connection to sql server
- SQL Server blocked access to procedure ‘sys.xp_cmdshell’ of component ‘xp_cmdshell’
In this tutorial, we learned how to fix the error, sql the configuration option ‘xp_cmdshell’ does not exist or it may be an advanced option.
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.