Friday, June 29, 2012

Index (zero based) must be greater than or equal to zero and less than the size of the argument list

You get the following error when you run the Standard reports to get information such as Disk Usage in SQL Server Management studio.

Index (zero based) must be greater than or equal to zero and less than the size of the argument list


If you check the database properties then you will find that the database is in Compatibility mode 80 (SQL Server 2000) and you need the compatibility mode to be at least 90 to run these reports.

The reason becomes obvious if you try to run the report via SQL Server 2005 Management studio. You will get the following error on SQL Server 2005 Management studio.

Unable to display report because the database has a compatibility level of 80. To view this report, you need to use the Database Properties dialog to change the compatibility level to SQL Server 2005 (90).


In order to resolve this you need to change the compatibility mode to at least 90. But before you do this please test all your applications to ensure that it works fine.