Enable xp_cmdshell in SQL Server



Cofiguring xp_cmd shell option can be done using two methods. Explicit xp_cmdshell option enabling is introduced in SQL Server 2005 and above. In SQL Server 2000, we should provide more access to the specific sql login user. In 2005 and above,

1. Using Surface Area configuration. Enable the xp_cmdshell option.
2. Use the below queries to achieve it.


-- To allow advanced options to be changed.

EXEC sp_configure 'show advanced options', 1
GO

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

RECONFIGURE
GO

-- To enable the feature.

EXEC sp_configure 'xp_cmdshell', 0 -- 0 for disable, 1 for enable
GO

-- To update the currently configured value for this feature.

RECONFIGURE
GO

Cheers,
Venkatesan Prabu .J
http://venkattechnicalblog.blogspot.com/

Ebook Download
View all
Learn
View all