Skip to content

Import Databases

Dr John Tunnicliffe edited this page May 16, 2019 · 3 revisions

Importing databases into SQL Server Data Tools (SSDT) is simplicity itself and only takes seconds. However, sorting out the links to other databases and bad code that lies therein can be difficult, but worth it! See Fixing Database Import Issues for our guide on solving these issues.

To import your database, first create a new Visual Studio SQL Server Project as shown below:

Create new Visual Studio SQL Server Project

Then click-right on the project and select Import Database

SQL Server Project - Import database

Using the dialog, enter server on which the database resides, select the database and click Import.

SQL Server Project - Import database options

As you will see from the next dialog, the import is very, very comprehensive and covers every object type that can possibly be in a SQL Server database. The import is also very fast, taking seconds to import every object in the database, even for large databases!

SQL Server Project - Import DB

Once completed, in the Visual Studio Solution Explorer, under the database project you will see a folder for every schema found in the source database. Below each folder will be an optional number of folders called Tables, Views, Stored Procedures etc. The example database used in the screenshots is extremely symplistic, hence the lack of folders.

Once you have imported your database, click Build Solution on the Build menu. Now your problems begin! See our guide for resolving issues here: Fixing Database Import Issues

SQL Server Project - Imported project