Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Access violation when a stored procedure is dropped before you execute END TRY section in SQL Server


View products that this article applies to.

Symptoms

Consider the following scenario:

• You have a stored procedure that contains a TRY…CATCH construct in Microsoft SQL Server.
• The stored procedure includes WITH RESULT SETS clause and is executed by the sp_prepare or sp_execute method.
• Before you execute END TRY section, the stored procedure is dropped. This causes a 2812 error that resembles "Could not find stored procedure <SP_Name>".

In this situation, the SQL Server crashes and generates an access violation (AV) that may eventually lead to the server shutdown. Additionally, a dump file is generated in the SQL Server error log folder.

↑ Back to the top


Resolution

This issue is fixed in the following cumulative updates for SQL Server:

Cumulative Update 7 for SQL Server 2016 RTM

Cumulative Update 3 for SQL Server 2016 SP1

Cumulative Update 6 for SQL Server 2014 SP2

Cumulative Update 13 for SQL Server 2014 SP1

Cumulative Update 9 for SQL Server 2012 SP3

About cumulative updates for SQL Server:

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Latest cumulative update for SQL Server 2016

Latest cumulative update for SQL Server 2014

Latest cumulative update for SQL Server 2012

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


References

Learn about the terminology that Microsoft uses to describe software updates.

↑ Back to the top


Keywords: kb, kbqfe, kbfix, kbsurveynew, kbexpertiseadvanced

↑ Back to the top

Article Info
Article ID : 4015561
Revision : 12
Created on : 7/5/2017
Published on : 8/8/2017
Exists online : False
Views : 360