Lesson 3: Importing a DAC to Visual Studio

In this lesson, you will create a new DAC project in Visual Studio, and then import the data-tier application (DAC) package you created in the previous lesson.

Procedures

Create a DAC project in Visual Studio

  1. Open Microsoft Visual Studio.

  2. On the File menu, point to New, and click Project.

    The.New Project dialog appears.

  3. Under Installed Templates, Expand the Database node, and then click the SQL Server node.

  4. In the list of templates, click Data-tier Application.

  5. In Name, type SampleDB.

  6. Accept the default Location and Solution Name.

  7. Select the Create directory for solution check box if it is not already selected.

  8. Clear the Add to Source Control check box if it is not already cleared, and click OK.

    The SampleDB project is created.

    Next, you will import the DAC package.

Import a data-tier application

  1. In the Visual Studio Solution Explorer pane, navigate to the node for the SampleDB project.

  2. Launch the Import Data-tier Application Wizard by right-clicking the node for the SampleDB, and then selecting Import Data-tier Application….

  3. Review the information on the Welcome page, and then select Next.

  4. On the Specify Import Options page:

    1. Select Import from a data-tier application package.

    2. Select the Browse button by the Package file name field.

    3. Navigate to the folder where you placed the SampleDB.dacpac file in the last lesson, select the file, and then select Open.

    4. Click Next.

    5. Review the report showing the status of the import actions, then select Finish.

  5. In Schema View, navigate to the dbo schema, navigate to the Tables, Views, and Stored Procedures nodes and observe that the objects created in the first lesson are now in the SampleDB DAC project.

Next Steps

This concludes the tutorial. Tutorials are brief overviews and do not describe all available options.