SQL Server Database Diagram Index was Outside the Bounds of the Array

By:   |   Updated: 2020-03-13   |   Comments (3)   |   Related: More > SQL Server Management Studio


Database diagrams can be very useful in terms of visually understanding the SQL Server database structure. It is possible to create a diagram for the whole database as well as for specific tables of the database. This illustration can be very helpful in easily understanding the table’s structure of the database and their relationships.

Creating a diagram is possible in SQL Server Management Studio (SSMS) prior to version 17. In the case of creating a diagram in version 17 of SSMS the following error message is received:

Index was outside the bounds of the array.

This is because in version 17, in spite of having the "Database Diagram" option under each database, it was actually removed and Microsoft considered it as a depreciated feature. This feature, however, is very useful for many developers and administrators and its absence can be quite uncomfortable. While it is possible to use many third-party tools to create database diagrams, we probably all agree that it is easier to have this feature integrated into SSMS.

Using older versions of SSMS will also solve the problem. Nevertheless, what if we want to use newer versions of SSMS with the "Database Diagram" feature?


Fortunately, despite expectations, the "Database Diagrams" feature is available with SSMS 18.1 and later. Thus, if we are using SSMS 17 thru 18.0, we can just upgrade to 18.1 and newer versions and have this feature available again.

We will illustrate this process step-by-step, but before that let’s see the problem in practice.

For instance, assume we need to create a database diagram for our sample TestDB database. In SSMS, we locate "Database Diagrams" just under the database, right-click on it and choose "New Database Diagram":

ssms create new database diagram

After that, we will receive the following error message:

ssms database diagram error

Now, let’s check the version of SSMS.

To do that, go to Help > About:

find ssms version

The version is 17.8.1:

ssms version

Update SSMS to Version 18.1 or later to solve database diagram error message

Let’s update SSMS.

To do so, close SSMS and follow this link to download the latest version.

At the time of writing this tip, the latest version of SSMS is 18.4 as shown below:

install ssms

Click the download link and after downloading, locate the EXE file and double-click on it to install:

install ssms

After that, click on "Install" to start the installation (you can change the location by clicking "Change" and choosing the desired location):

install ssms

After installation, a restart is needed, so click "Restart":

install ssms

When the computer is restarted, we can search for the new version of SQL Server Management Studio by typing ssms:

find and launch ssms

As we can see above, version 18 is installed, but the version 17 is still available. Hence, installing the version 18 does not override version 18. If we do not need the older version, we can just uninstall it.

Let’s start version 18 by clicking on it. As we are using it for the first time, we are asked whether to import settings from SSMS 17 or not. We will click "Import from SSMS 17" to import:

import ssms settings

We can see that the SSMS version is 18.4:

ssms version

Create Database Diagram

If in this new version of SSMS we click on "New Database Diagram", a window for creating a new diagram will be successfully opened. We can choose tables which will be added into the diagram (we have chosen both tables in our database) by clicking "Add":

ssms create database diagram

Now we can see our tables structures and their references in our diagram:

ssms create database diagram

We choose a name for the diagram and click the "Save" button. Now, it is stored permanently.

ssms create database diagram

The diagram can be found under "Database Diagrams":

ssms database diagrams


In conclusion, although creating a database diagram is a quite useful feature among many developers and DBAs, it is unavailable in the version 17 of SSMS. In newer versions of SSMS, however, this feature is available again. Thus, we have fixed the problem of creating a database diagram in SSMS 17 by upgrading it to SSMS 18.4.

Next Steps

To find more information about the discussed topic, please follow the links below:

Last Updated: 2020-03-13

get scripts

next tip button

About the author
MSSQLTips author Sergey Gigoyan Sergey Gigoyan is a database professional with more than 10 years of experience, with a focus on database design, development, performance tuning, optimization, high availability, BI and DW design.

View all my tips
Related Resources

Comments For This Article

Thursday, August 13, 2020 - 4:13:09 AM - Piquet Back To Top (86300)
It is quite unbelievable that Microsoft would even consider deprecating such a valuable & useful feature in SSMS - astounding!
I am using SSMS v18.6 and this "Index was outside the bounds of the array" error still occurs when I try to create a New Database Diagram :-(. - I've experienced this at multiple sites on multiple workstations (SQL 2019).
Interestingly I can open and modify EXISTING database diagrams without any problems - I just get errors if I try to create a NEW diagram...
Most annoying...

Monday, May 25, 2020 - 6:07:43 AM - ArnoNym Back To Top (85760)

The issue still exists in SSMS 18.4. Any additional steps to help resolve it?

Friday, March 13, 2020 - 9:16:23 AM - Kevin Back To Top (85103)

Does this also apply to the Query Designer? I have a user with a background in Access that does all of his queries in the designer out of habit.


Recommended Reading

Different Options for Query Results in SQL Server Management Studio

Display Line Numbers in a SQL Server Management Studio Query Window

Connect to SQL Servers in another domain using Windows Authentication

Executing large scripts in SQL Server Management Studio with Insufficient Memory Failures

Top 5 SSMS Time Saving Tips

get free sql tips
agree to terms