Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Why does xp _ cmdshell sql automatically run in sql 2005?


Asked by Savannah Clark on Dec 12, 2021 SQL



Your problem is when you execute xp_cmdshell SQL automatically runs in SQL 2005 version instead of using DTExec.exe from SQL 2008 directory. If you don't have other BAT files running using DTExec.exe from 2005 then just leave it renamed and off you go.
Besides,
When you execute xp_cmdshell SQL Server runs a command at the operating system level similar to the old DOS prompt, or CMD shell. There are many security concerns and misconceptions about xp_cmdshell as documented in an earlier post.
Likewise, If you don’t run that you will probably see a message like this: 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.
In addition,
When first enabled, xp_cmdshell requires CONTROL SERVER permission to execute and the Windows process created by xp_cmdshell has the same security context as the SQL Server service account. The SQL Server service account often has more permissions than are necessary for the work performed by the process created by xp_cmdshell .
One may also ask,
When xp_cmdshell is called, SQL Server does not care about the output and does not consider any failure. However, you can insert the output to temp table and see the result.