Resolving “Index was out of range” in SSMS

This post is here to help if you’ve encountered the following error while performing a task in SQL Server Management Studio (SSMS):

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

Index Out of Range SQL Server Management Studio

In my experience, I’ve seen this come up several times when trying to change the order of steps in a SQL Agent Job in SSMS.

Resolving “Index was out of range” Issue

To resolve this issue, update to the latest version of SSMS.

Feel free to follow my link for installing the latest version of SSMS which includes a link to the Microsoft download and some useful SSMS tips from a DBA. Otherwise, the quick official link is here: Microsoft Docs: SSMS Download

Full Error Message & Follow-Up

This error might even happen for you even if using the latest version of SSMS. I’m not sure what the root cause is, but the first best troubleshooting step is to update SSMS as explained.

Here’s the full error I got:

I tried to change the SQL Agent job step here from step 3 to 1:

SQL Agent Job Steps
SQL Agent Job Step Order Change

I got this error message when I hit the button above:

Index Out of Range error SSMS
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 SSMS resolved for you, or if you’ve done that and still having the issue, please feel free to add a comment below!


Comments

2 responses to “Resolving “Index was out of range” in SSMS”

  1. Prashanth A Avatar
    Prashanth A

    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

  2. Vijay Avatar
    Vijay

    This worked for me too! Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Posts
Categories
Tags

Always On Availability Groups (AAG) (4) AWS (4) AWS Redshift (6) Database Admin (72) Database Backups & Recovery (14) Database Mirroring (2) Error Messages (5) Failover Cluster Instances (FCI) (1) Git Commands (6) Importing & Exporting Data (2) Linked Servers (3) Linux Administration (2) Logging & Monitoring (1) Microsoft Patching (2) MySQL (4) Postgres (6) PowerShell Scripts (2) SQL Certificates & Encryption (3) SQL Server Agent (5) SQL Server CDC (2) SQL Server Data Types (2) SQL Server Management Studio (SSMS) (16) SQL Server Networking (3) SQL Server on Linux (1) SQL Server Patching (2) SQL Server Performance Tuning (6) SQL Server Processes (SPIDs) (7) SQL Server Replication (2) SQL Server Scripts (13) SQL Server Security (4) SQL Server Storage (10) Windows Admin (21) Windows Authentication (2) Windows Automation (1) Windows Events (2) Windows Firewall (4) Windows Subsystem for Linux (WSL) (18)