Select the product you need help with
FIX: The first execution of the xp_cmdshell stored procedure is not completed until the last execution is complete in SQL Server 2012Article ID: 2671318 - View products that this article applies to. On This PageMicrosoft distributes Microsoft SQL Server 2012 fixes in one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security updates that were included with the previous SQL Server 2012 update release. SymptomsAssume that you run many xp_cmdshell stored procedures at the same time on multiple sessions in Microsoft SQL Server 2012. In this situation, the first execution of the xp_cmdshell stored procedure is not completed until the last execution is complete. CauseThis issue occurs because a handle is inherited by the processes that are opened when you run xp_cmdshell stored procedures at the same time. The CreateProcess API requires handle inheritance to redirect the standard output and error message. If multiple executions of the xp_cmdshell stored procedure run at the same time, newly-opened processes can inherit the handle from existing processes. However, the xp_cmdshell stored procedure waits for the handle to be closed by all the open processes. Therefore, when multiple processes inherit the handle, all xp_cmdshell executions must wait until the handle is closed by the longest-running process. ResolutionTo resolve this issue, apply the following cumulative update. This update adds CreateProcess API STARTUPINFOEX options that prevent the handle inheritance for cross process. Cumulative update informationCumulative update package 1 for SQL Server 2012 Service Pack 1The fix for this issue was first released in Cumulative Update 1. For more information about how to obtain this cumulative update package for SQL Server 2012 Service Pack 1, click the following article number to view the article in the Microsoft Knowledge Base:2765331 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2765331/
)
Cumulative update package 1 for SQL Server 2012 Service Pack 12772858
(http://support.microsoft.com/kb/2772858/
)
The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was releasedSQL Server 2012The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2012, click the following article number to view the article in the Microsoft Knowledge Base:2758687 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2758687/
)
Cumulative update package 4 for SQL Server 20122692828
(http://support.microsoft.com/kb/2692828/
)
The SQL Server 2012 builds that were released after SQL Server 2012 was releasedStatusMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. ReferencesFor more information about the CreateProcess function, go to the following MSDN website: General information about the CreateProcess function For more information about the xp_cmdshell stored procedure, go to the following MSDN website:
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx)
General information about the xp_cmdshell stored procedure For more information about a similar issue, click the following article number to view the article in the Microsoft Knowledge Base:
(http://msdn.microsoft.com/en-us/library/ms175046.aspx)
315939
(http://support.microsoft.com/kb/315939/
)
PRB: Child Inherits Unintended Handles During CreateProcess Call Properties | Article Translations
|


Back to the top








