Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.


Assume that you run a query with aggregates and joins (for example: COUNT WITH GROUP BY) on a table with filtered index in SQL Server that's used as a remote server, and the user doesn't have the VIEW DEFINITION permission. In this scenario, the linked server considers the filtered index as a full unique index, and the query returns incorrect results. 

More information

When you run a remote query, the linked server process uses index metadata to optimize the query. When you don't have VIEW DEFINITION permission for the database being queried, the metadata doesn't indicate that the index is a filtered index, and the query optimizer considers the index to be a full unique index. This fix corrects the index metadata for a filtered index when you don't have VIEW DEFINITION permission for consideration by the Query Optimizer.


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


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

Note: This fix should be applied to the remote linked server.

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:


To work around this issue, try either of the following methods:

  • Remove the filtered index.

  • Grant view definition to the user. Ex: GRANT VIEW DEFINITION TO test_user;


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

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!