Menu & Search
“Index was out of range” SQL Server Management Studio

“Index was out of range” SQL Server Management Studio

I’ve seen this Index was out of range error within SQL Server Management Studio (SSMS) when trying to change the order of Agent Jobs.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index (mscorlib)

If I create a new SQL Agent Job, and add in 3 random steps…

SQL Agent Job Steps

Then try move the 3rd step highlighted above upwards in the step order.

SQL Agent Job Step Order Change

The following error will show.

Index Out of Range SQL Server Management Studio
Index out of range Full Error

Googling the error leads on to some random .NET developer stuff… I’ve fixed the issue before by updating SQL Server Management Studio (SSMS), but I just tested this on the 18.0 RC1 build of SSMS and I was still able to recreate the issue. So, not sure what’s going on here yet!

1 Comment

  1. Prashanth A
    3 years ago

    Great ! Works ! I was getting same Error and your Suggestion is Cleared my issue. Thanks for your Post and helps to over come from issue