This post is to share encounters with the “Index was out of range” error message while working in SQL Server Management Studio (SSMS), and to hopefully help you quickly resolve it error.
If you get this error, your first troubleshooting step should be to update SQL Management Studio. This solved it for me on more than one occasion. You can update SSMS by downloading and installing the latest client using this Microsoft Link – Download SQL Server Management Studio.
Identifying the Index Out of Range Error
Full error message:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index (mscorlib)
When attempting to move a SQL Server Agent job step from job step 1 to job step 3, the above error message is prompted on the screen. I was unable to perform this action until this was resolved.
As mentioned above an update of the SSMS client was the fix. If I saw such errors on my test instances my next troubleshooting step would be to ensure the SQL Servers are running with the latest CUs as I am often running non-GA (pre-release) software.
Hope this one was useful for you. If you’ve seen this happen for other reasons feel free to add a comment.