KB2950189 - FIX: An access violation occurs when you execute update query on a table that has a DML trigger in SQL Server

Applies To
SQL Server 2008 R2 Service Pack 2 SQL Server 2008 R2 Developer SQL Server 2008 R2 Enterprise SQL Server 2008 R2 Standard SQL Server 2012 Developer SQL Server 2012 Enterprise SQL Server 2012 Standard SQL Server 2014 Developer - duplicate (do not use) SQL Server 2014 Enterprise - duplicate (do not use) SQL Server 2014 Standard - duplicate (do not use)

Symptoms

Assume that you have a table that has a DML trigger in Microsoft SQL Server 2008 R2, SQL Server 2012, or SQL Server 2014 and in that trigger you join inserted/deleted table with other tables. When you execute a DML statement on this table, an access violation may occur during trigger compilation and you receive the following error:

Note

A severe error occurred on the current command. The results, if any, should be discarded.

Additionally, following errors are logged in SQL Server error log:

Note

<Date><Time> spid# ***Stack Dump being sent to <FilePath>⁠\SQLDumpxxx.txt
<Date><Time> spid# SqlDumpExceptionHandler: Process # generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
<Date><Time> spid# * *******************************************************************************
<Date><Time> spid# *
<Date><Time> spid# * BEGIN STACK DUMP:
<Date><Time> spid# * <Date><Time> spid #
<Date><Time> spid# *
<Date><Time> spid# *
<Date><Time> spid# * Exception Address = 00000000009E4F2A Module(sqlservr+00000000002D4F2A)
<Date><Time> spid# * Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
<Date><Time> spid# * Access Violation occurred writing address 0000000000000000
<Date><Time> spid# * Input Buffer 510 bytes -
<Date><Time> spid# * SQL_query_code

Resolution

The issue was first fixed in the following cumulative update of SQL Server.

Cumulative Update 1 for SQL Server 2012 SP2 /en-us/help/2976982

Cumulative Update 2 for SQL Server 2014 /en-us/help/2967546

Cumulative Update 10 for SQL Server 2012 SP1 /en-us/help/2954099

Cumulative Update 12 for SQL Server 2008 R2 SP2 /en-us/help/2938478

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:

      

Workaround

To work around the issue, do not use the inserted/deleted table directly in a query joining it with other tables, instead cache it in a temp table and use the temp table in the query.

Status

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