An error occurred during the execution of xp_cmdshell

  • In SQL Server 2005, once in a while, the xp_cmdshell gives the

    following error.

    "An error occurred during the execution of xp_cmdshell. A call to

    'CreateProcess' failed with error code: '5'. [SQLSTATE 42000] (Error

    15121). The step failed.".

    Does Looping has a limitation on the number of times it can call

    xp_cmdshell.

    It works good whenever we call it individually.

    Thanks in Advance

  • I have not heard of any issues about this.

    If you do not hear from anyone else in the next 2 days who has a solution to your problem, my recommendation is to raise this as a fault with Microsoft as it may be a bug.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Thanks for those words..Keep viewing the forum for more such error you have ever seen or heard.

  • error code: '5'. implies Access Denied.

    Check the File access permissions that the SQL Agent Account has on the file(s)/Folder(s) you are trying to access


    * Noel

  • Hi All,

    I faced a similar issue when deploying a COM DLL on Windows 2003 Server running MS SQL 2005. xp_cmdshell was enabled but I was getting an event log entry mentioning error code '5'. I changed the SQL server service' logon to local administrator and that fixed the issue for me.

  • Though I'd add the exact error message from event log so here goes...

    [font="Courier New"] An error occurred during the execution of xp_cmdshell. A call to 'CreateProcess' failed with error code: '5'.[/font]

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply