FIX: Access violation in SQL Server 2014 when large number of rows are inserted into a partitioned columnstore index

S’applique à : SQL Server 2014 DeveloperSQL Server 2014 EnterpriseSQL Server 2014 Enterprise Core

Symptoms


Assume that you have a partitioned table with a clustered columnstore index (CCI) built on it in Microsoft SQL Server 2014. When you try to insert rows into that table by using the Bulk Insert operation (for example, INSERT INTO… SELECT FROM…), SQL Server may throw an access violation (AV) error if the following conditions apply to your table:

  • The table has a CHECK CONSTRAINT on the second column or higher columns.
  • You drop one or more columns preceding the column with the CHECK CONSTRAINT from the table, thus creating gaps in the column ordinal numbers.
  • Then you bulk insert data into the second or subsequent partition (but not the first partition) that has been either:
    • Reorganized by using ALTER INDEX … REBUILD PARTITION = <Your partition number, second or higher>.
    • Switched for a stage table by using ALTER TABLE … SWITCH TO … PARTITION <Your partition number, second or higher>.

When that happens, you may receive an error message that resembles the following, and an AV dump file will be automatically generated in the SQL Server error log folder:

Error message:
Msg 596, Level 21, State 1, Line LineNumber
Cannot continue the execution because the session is in the kill state.
Msg 0, Level 20, State 0, Line LineNumber
A severe error occurred on the current command. The results, if any, should be discarded.

Resolution


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

Cumulative Update 5 for SQL Server 2014 SP2

Status


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

References


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