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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: