Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

With the Reverse Engineer Wizard, you can create a database model from an existing database or an Excel workbook. Database models graphically show the structure of a database so you can see how database elements, such as tables and views, relate to each other without showing the actual data. This can streamline creating a new database or understanding the structure of an existing one.

Important: Reverse engineering is supported for SQL Server 2016 and earlier versions. It is not supported for SQL Server 2019 or newer versions.

The Database Model Diagram template lets you create a database model from an existing database. This template is available in the Visio app for those with Visio Plan 2 or a Visio 2019 license. If you're not sure what version of Visio you're using, click File > Account > About Visio.

Review what the Reverse Engineer Wizard extracts

The schema definition information that the wizard can extract depends on a combination of things, such as the capabilities of the database management system (DBMS) and ODBC driver. The wizard shows all the elements it can extract and lets you choose which ones you want. For example, you may be interested in only 5 out of 10 tables, and 2 out of 4 views.

While you are running the wizard you can choose to have it automatically create the drawing in addition to listing the reverse engineered items in the Tables and Views window. If you decide not to have the drawing created automatically, you can drag the items from the Tables and Views window onto your drawing page to manually assemble the database model.

To the extent that they are available from the target DBMS, you can extract the following:

  • Tables

  • Views

  • Primary keys

  • Foreign keys

  • Indexes

  • Triggers (including code)

  • Check clauses (including code)

  • Stored procedures (including code)

Prepare to start the wizard

If you are reverse engineering an Excel workbook, before you start the wizard you need to open the workbook and name the group (or range) of cells that contain the column headings. If you want to use more than one worksheet, just name the group of column cells in each worksheet. These ranges are treated like tables in the wizard. For more information about how to name a range of cells, see the Excel help.

For best results, set your default driver to the target database that you want to reverse engineer before you run the Reverse Engineer Wizard. This ensures that the wizard maps the native data types correctly and that all the code extracted by the wizard displays correctly in the Code window.

  1. Click the File tab, click New, click Templates, click Software and Database, and then double-click Database Model Diagram.

  2. On the Database tab, in the Manage group, click Database Drivers.

  3. On the Drivers tab select the Visio-supplied driver for your DBMS. For example, if you are designing an Access database you would choose Microsoft Access.

    If you are reverse engineering an Excel worksheet, choose the ODBC Generic Driver.

  4. Click Setup.

  5. On the ODBC drivers tab, select the check box for the vender-supplied driver for your DBMA. For example, if you are designing an Access database you would select the Microsoft Access Driver (*.mdb, *.accdb) check box.

  6. Click OK in each dialog box.

A vendor-supplied 32-bit ODBC driver must be from an ODBC Data Access Pack greater than version 2.0 and ODBC Level 1-compliant or greater. A vendor-supplied OLE DB provider must be compliant with the OLE DB version 1.0 or later specification.

Reverse engineer an existing database

  1. In your database model diagram, on the Database tab, click Reverse Engineer.

  2. On the first screen of the Reverse Engineer Wizard, do the following:

    1. Select the Microsoft Visio database driver for your database management system (DBMS). If you have not already associated the Visio database driver with a particular ODBC data source, click Setup to do so now.

      If you are reverse engineering an Excel worksheet, choose the ODBC Generic Driver.

    2. Select the data source of the database you are updating. If you have not already created a data source for the existing database, click New to do so now.

      When you create a new source, its name is added to the Data Sources list.

    3. When you are satisfied with your settings, click Next.

    4. Follow the instructions in any driver-specific dialog boxes. For example, in the Connect Data Source dialog box, type a user name and password, and then click OK. If your data source isn't password protected, click OK.

  3. Select the check boxes for the type of information that you want to extract, and then click Next.

    Some items may be grayed out because not all systems support all the kinds of elements the wizard can extract.

  4. Select the check boxes for the tables (and views, if any) that you want to extract, or click Select All to extract them all, and then click Next.

    If you are reverse engineering an Excel worksheet and don't see anything in this list, then it is likely that you need to name the range of cells that contain the column headings in your spreadsheet.

  5. If you selected the Stored Procedures check box in step 3, select the procedures that you want to extract, or click Select All to extract them all, and then click Next.

  6. Select whether you want the reverse engineered items added automatically to the current page.

    You can choose to have the wizard automatically create the drawing in addition to listing the reverse engineered items in the Tables and Views window. If you decide not to have the drawing created automatically, you can drag the items from the Tables and Views window onto your drawing page to manually assemble the database model.

  7. Review your selections to verify that you are extracting the information you want, and then click Finish.

If you use the ODBC Generic Driver, you may receive an error that indicates that the reverse engineered information may be incomplete. In most cases this isn't a problem — just click OK and continue with the wizard.

The wizard extracts the selected information and displays notes about the extraction process in the Output window.

The Database Model Diagram template lets you create a database model from an existing database. This template is available in the Visio app for those with Visio Plan 2 or a Visio 2019 license. If you're not sure what version of Visio you're using, click File > Account > About Visio.

Review what the Reverse Engineer Wizard extracts

The schema definition information that the wizard can extract depends on a combination of things, such as the capabilities of the database management system (DBMS) and ODBC driver. The wizard shows all the elements it can extract and lets you choose which ones you want. For example, you may be interested in only 5 out of 10 tables, and 2 out of 4 views.

While you are running the wizard you can choose to have it automatically create the drawing in addition to listing the reverse engineered items in the Tables and Views window. If you decide not to have the drawing created automatically, you can drag the items from the Tables and Views window onto your drawing page to manually assemble the database model.

To the extent that they are available from the target DBMS, you can extract the following:

  • Tables

  • Views

  • Primary keys

  • Foreign keys

  • Indexes

  • Triggers (including code)

  • Check clauses (including code)

  • Stored procedures (including code)

Prepare to start the wizard

If you are reverse engineering an Excel workbook, before you start the wizard you need to open the workbook and name the group (or range) of cells that contain the column headings. If you want to use more than one worksheet, just name the group of column cells in each worksheet. These ranges are treated like tables in the wizard. For more information about how to name a range of cells, see the Excel help.

For best results, set your default driver to the target database that you want to reverse engineer before you run the Reverse Engineer Wizard. This ensures that the wizard maps the native data types correctly and that all the code extracted by the wizard displays correctly in the Code window.

  1. Click the File tab, click New, click Templates, click Software and Database, and then double-click Database Model Diagram.

  2. On the Database tab, in the Manage group, click Database Drivers.

  3. On the Drivers tab select the Visio-supplied driver for your DBMS. For example, if you are designing an Access database you would choose Microsoft Access.

    If you are reverse engineering an Excel worksheet, choose the ODBC Generic Driver.

  4. Click Setup.

  5. On the ODBC drivers tab, select the check box for the vender-supplied driver for your DBMA. For example, if you are designing an Access database you would select the Microsoft Access Driver (*.mdb, *.accdb) check box.

  6. Click OK in each dialog box.

A vendor-supplied 32-bit ODBC driver must be from an ODBC Data Access Pack greater than version 2.0 and ODBC Level 1-compliant or greater. A vendor-supplied OLE DB provider must be compliant with the OLE DB version 1.0 or later specification.

Reverse engineer an existing database

  1. In your database model diagram, on the Database tab, click Reverse Engineer.

  2. On the first screen of the Reverse Engineer Wizard, do the following:

    1. Select the Microsoft Visio database driver for your database management system (DBMS). If you have not already associated the Visio database driver with a particular ODBC data source, click Setup to do so now.

      If you are reverse engineering an Excel worksheet, choose the ODBC Generic Driver.

    2. Select the data source of the database you are updating. If you have not already created a data source for the existing database, click New to do so now.

      When you create a new source, its name is added to the Data Sources list.

    3. When you are satisfied with your settings, click Next.

    4. Follow the instructions in any driver-specific dialog boxes. For example, in the Connect Data Source dialog box, type a user name and password, and then click OK. If your data source isn't password protected, click OK.

  3. Select the check boxes for the type of information that you want to extract, and then click Next.

    Some items may be grayed out because not all systems support all the kinds of elements the wizard can extract.

  4. Select the check boxes for the tables (and views, if any) that you want to extract, or click Select All to extract them all, and then click Next.

    If you are reverse engineering an Excel worksheet and don't see anything in this list, then it is likely that you need to name the range of cells that contain the column headings in your spreadsheet.

  5. If you selected the Stored Procedures check box in step 3, select the procedures that you want to extract, or click Select All to extract them all, and then click Next.

  6. Select whether you want the reverse engineered items added automatically to the current page.

    You can choose to have the wizard automatically create the drawing in addition to listing the reverse engineered items in the Tables and Views window. If you decide not to have the drawing created automatically, you can drag the items from the Tables and Views window onto your drawing page to manually assemble the database model.

  7. Review your selections to verify that you are extracting the information you want, and then click Finish.

If you use the ODBC Generic Driver, you may receive an error that indicates that the reverse engineered information may be incomplete. In most cases this isn't a problem — just click OK and continue with the wizard.

The wizard extracts the selected information and displays notes about the extraction process in the Output window.

Visio 2016 and 2013 don't support the Reverse Engineer Wizard

We're sorry. The Reverse Engineer Wizard isn't available in Visio Professional 2016, Visio Standard 2016, Visio Professional 2013, or Visio Standard 2013. In order to use the database modeling features, consider upgrading to Visio Plan 2.

Get the new version

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×