SQL Stored Procedure XP_CMDSHELL

By James|10/11/2011|,

If you need to run T-SQL scripts/queries that utilize the xp_cmdshell stored procedure, SQL must be reconfigured to allow this:

  • Launch SQL Management Studio and connect to the SQL server
  • In the left pane, right click on the server name and select Facets
  • Select Surface Area Configuration from the Facet drop down.
  • Double click on the line which reads XPCmdShellEnabled to change the value from False to True
  • Click OK

Another thing to keep in mind is that the SQL Server service account must have permission to any files/folders that the stored procedure will create/modify/delete!

Copyright 2011 - 2024 The Lazy IT Admin | All Rights Reserved
menu-circlecross-circle linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram