Xp_cmdshell is possibly the most dangerous extended stored procedure on the planet. I’ve seen some serious impact on a combination of xp_cmshell enabled and sysadmin rights. The main reason for it’s dangerous image is xp_cmdshell allows shell scripts to execute on OS. My general rule is to not allow non DBAs xp_cmdshell direct access. If a user requests xp_cmdshell with a valid and pragmatic reason, then I’ll set up a stored procedure – allowing them to run only xp_cmdshell through this stored procedures. Think about adding a check on input parameters to this managed store procedure There are valid reasons... Read more →