Cari Blog Ini

30 April 2012

Msg 15281: SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell'

Error Messages : 


Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1 

SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' 

because this component is turned off as part of the security configuration for this server. 

A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. 

For more information about enabling 'xp_cmdshell', 

see "Surface Area Configuration" in SQL Server Books Online.



Solution:


--1.
-- 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


--Result Messages: Configuration option 'show advanced options' changed from 1 to 1. Run the
--RECONFIGURE statement to install.



--2.
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO


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

--Result Messages: Configuration option 'xp_cmdshell' changed from 0 to 1.
--Run the RECONFIGURE statement to install.



Source:
http://msdn.microsoft.com/en-us/library/ms175046(SQL.105).aspx