KB4016902 - FIX: Access violation when you use SELECT TOP query to retrieve data from clustered columnstore index in SQL Server 2016

Applies To
SQL Server 2016 Developer - duplicate (do not use) SQL Server 2016 Enterprise - duplicate (do not use) SQL Server 2016 Enterprise Core - duplicate (do not use) SQL Server 2016 Standard - duplicate (do not use) SQL Server 2016 Service Pack 1

Symptoms

Assume that you have installed Microsoft SQL Server 2016 Service Pack 1 (SP1). When you use the SELECT TOP N statement with a very large N (tens or hundreds of thousands) to retrieve data from a columnstore index in batch mode, you get an access violation (AV) error.

Resolution

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

Cumulative Update 3 for SQL Server 2016 SP1

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

Workaround

The temporary workaround for this issue is to remove the keyword TOP from SELECT statement or enable Trace Flag - TF 9453 to disable batch mode.

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.