Use T-SQL to turn on XP_CMDSHELL

by Joe Hunter 6. July 2010 12:02

ALTER PROCEDURE USP_TURN_ON_XP_CMDSHELL

AS

BEGIN

    -- To allow advanced options to be changed.
    EXEC sp_configure 'show advanced options', 1
   
    -- To update the currently configured value for advanced options.
    RECONFIGURE
   
    -- To enable the feature.
    EXEC sp_configure 'xp_cmdshell', 1
   
    -- To update the currently configured value for this feature.
    RECONFIGURE
   

END

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen