SQL Server "Index usage statistics" causes "invalid syntax near") "

In SQL Server 2008 R2 Standard Edition:

SELECT @@version


Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) 06/17/2011 00:54:03 Copyright (c) Microsoft Corporation Standard Edition (64-bit) for Windows NT 6.1 (Build 7601: Service Pack 1)

with tools without expression:

Microsoft SQL Server Management Studio    10.50.2500.0 
Microsoft Data Access Components (MDAC)   6.1.7601.17514 
Microsoft MSXML                           3.0 6.0
Microsoft Internet Explorer               9.0.8112.16421
Microsoft .NET Framework                  2.0.50727.5448
Operating System                          6.1.7601


runs on Windows Small Business Server 2011 Standard 64-bit:

enter image description here

Against a database in SQL Server 2000 compatibility mode:

enter image description here

If I try to run the Index Usage Statistics report , I get an error:

enter image description here

How do you make him leave?

I ditched every red herring I could think of. There should be enough extraneous information that everyone can throw out the theory.


source to share

1 answer

Various reports in SQL Server Mgmt Studio use DMVs (Dynamic Management Views ) such as sys.dm_db_index_usage_stats

to get their data.

These DMVs are only available if you are running compatibility level 90 (SQL Server 2005) or higher. You won't be able to get this to work if you are stuck with the SQL Server 2000 compatibility level (80) unfortunately.



All Articles