Enable XP_cmdshell in SQL Server 2008

XP_CMDSHELL is very useful extended stored procedure in Microsoft SQL Server 2008 which will give you power to run command as an operating system power shell. By default it is disabled in any Microsoft SQL server version due to security reasons but you can enable it for your need. Herewith, I am giving you T-SQL commands to enable it.
–list all setting which you can configure with SP_Configure stored procedure
–you may not be able to see XP_CMDSHELL command in the list.
EXECUTE SP_CONFIGURE
–see full list of command by making show advanced options ON
EXECUTE SP_CONFIGURE ‘show advanced options’, 1
RECONFIGURE WITH OVERRIDE
GO
–enable xp_cmdshell command
EXECUTE SP_CONFIGURE ‘xp_cmdshell’, ‘1’
RECONFIGURE WITH OVERRIDE
GO

Reference: Ritesh Shah
http://www.sqlhub.com
Note: Microsoft Books online is a default reference of all articles but examples and explanations prepared by Ritesh Shah, founder of http://www.SQLHub.com
Microsoft SQL Server Blog. Fight the fear of SQL with SQLHub.com. Founder is Ritesh Shah

Author: Riteshshah

Ritesh Shah is a database professional with having 16+ years of experience in various domain of IT field. He is a author of many technical articles on Microsoft Technology and authored a book of SQL Server 2012 Performance Tuning cookbook. He loves work with different Microsoft Products.