Menu & Search

“Index was out of range” SQL Server Management Studio

“Index was out of range” SQL Server Management Studio

If you try to change the order of steps in an Agent Job within SQL Server Management Studio (SSMS), you may encounter the error “Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index (mscorlib)“.

This error can occur even if you are using the latest version of SSMS. It’s unclear what the root cause of this issue is, but I have been able to resolve it for myself and some others by updating to the latest version of SSMS.

Resolve “Index was out of range” SSMS Issue

As mentioned above the resolution is to update to the latest SSMS version. For demo purposes, I’m going to show the actual error I was encountering here.

I create a new SQL Agent Job with 3 job steps:

SQL Agent Job Steps

When I try move the job step 3 (import_second_table) run order from 3 to 2, the Index was out of range error prompts:

SQL Agent Job Step Order Change
Index Out of Range SQL Server Management Studio
Index out of range Full Error

Searching for this error online often led me to a lot of unrelated information about .NET development. If updating SQL Server Management Studio (SSMS) has not resolved this issue for you, feel free to leave a comment and we can troubleshoot here.

1 Comment

  1. Prashanth A
    4 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