Lesson 2: Extracting a Data-Tier Application

In this lesson, you will extract a data-tier application (DAC) package from the sample database you created in the previous lesson. The Extract Data-tier Application Wizard creates a DAC definition that describes the selected instance-level and database objects. The wizard builds the DAC definition into a DAC package, which is a zipped file that contains the DAC definition. The DAC package is used to deploy a DAC to an instance of the Database Engine much the same way a Windows installer (.msi) file is used to install an application executable.

Procedures

Extract a Data-tier Application

  1. In the SQL Server Management Studio Object Explorer pane, navigate to the Databases node for the instance where you created the SampleDB.

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

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

  4. On the Set Properties page, enter the following values:

    1. Leave the value SampleDB in the Name field.

    2. In the Version field, change 1.0.0.0 to 1.0.1.1.

    3. In the Description field, type: Extract a DAC from SampleDB.

    4. In the Save to DAC package file, keep the default path and the default file name SampleDB.dacpac.

  5. Click Next. The wizard displays a progress bar as it extracts all of the objects from SampleDB and validates that it can successfully build a DAC package.

  6. On the Validation and Summary page, review the settings that will be used to extract the DAC package, and then click Next.

  7. The wizard builds a DAC package and saves the file to the location specified on the Set Properties page. Review the Build Package page to ensure all of the actions taken to build the package were successful. Select Finish to terminate the wizard.

  8. If Visual Studio is running on another computer, copy SampleDB.dacpac to a location that can be accessed by Visual Studio.

Next Steps

You have successfully extracted a DAC package. Next, you will use the DAC package to import the SampleDB elements into a new DAC project in Visual Studio. See Lesson 3: Importing a DAC to Visual Studio.