How to: Create a Data-tier Application Project

Visual Studio 2010
Important note Important

To create and manage databases using the latest version of Data Tier Applications (DACPAC), install the most recent release of SQL Server Data Tools from Get Started with Microsoft SQL Server Data Tools.

A data-tier application (DAC) project is single unit of management for developing and deploying all of the SQL Server data-tier objects used by an application. You create a DAC project and set the project properties manually.

To create a data-tier application project

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

    The New Project dialog box appears.

  2. Under Installed Templates, expand the Database node and select SQL Server.

  3. In the list of templates, select Data-tier Application.

  4. In Name, type the name that you want to give the project.

    The project name becomes the name of the DAC, the name of the DAC package file generated by the build, and the name of the database created to hold the objects defined in the DAC.

  5. In Location, type or click the path of the directory in which you want to create the project.

  6. In Solution, click Create new Solution if you want to create a solution for the project. If you want to add the project to the existing solution, click Add to Solution.

  7. If you want to create a directory to contain the solution, select the Create directory for solution check box.

  8. In Solution Name, type the name that you want to give the solution.

    By default, the solution name matches the project name.

  9. Perform one of the following steps:

    • Make sure that the Add to Source Control check box is selected if you want to add the new solution and project to version control immediately.

    • Clear the Add to Source Control check box if you will add the solution and project to version control later, or if you do not plan to use version control with this solution.

  10. Click OK.

    The project and solution are created.

    Next, you edit the project properties to specify the option settings for this project.

To configure data-tier application project properties

  1. In Solution Explorer, select the DAC project for which you wish to set properties.

  2. Use one of these steps to open the project property pages:

    • In Solution Explorer, right-click the DAC project and select Properties.

    • On the View menu, select Property Pages.

    • On the Project menu, select projectname Properties…

  3. Select the Project Settings tab.

  4. In Model collation, select the collation most similar to the collation of the environment where you plan to deploy the DAC. Collations define the sets of characters that can be stored in a database, along with the behaviors of sorting and comparison operations.

  5. In Default schema, specify the default schema for any new objects created in the DAC. You can specify other schemas when you create an object.

  6. Select the Build tab.

  7. In Database collation, specify the default collation that will be assigned to the database created to hold the objects defined in the DAC when the DAC is deployed.

  8. In Build output path, specify the path structure for the DAC package file created by the build process.

  9. In Build output file name, specify the name for the DAC package file created by the build process.

  10. Select the Build Events tab.

  11. Select the Edit Pre-build… button to specify a command line command to be run before each build.

  12. Select the Edit Post-build… button to specify a command line command to be run after each build.

  13. In Run the post-build event, specify whether you want the post-build command to be run after every build, or only if the build was successful.

  14. Select the Deploy tab.

  15. In Destination connection string, specify a valid connection string for the instance of the SQL Server Database Engine where you wish to deploy the DAC.

  16. In Data-tier application instance name, specify the name to be given to the DAC when it is deployed. The name is also given to the database created during the deployment.

  17. Select Validate policy on target instance if you want the DAC server selection policy evaluated when the DAC is deployed to an instance of the database engine.

  18. Select the Code Analysis tab.

  19. Select Enable Code Analysis on Build if you want the code analysis rules evaluated each time the project is built.

  20. Select the set of rules you want evaluated on each build.

  21. For any rule you want treated as an error rather than a warning, select Treat Warning as Error.

    The project is now ready for you to use. You can check it in to version control if you are working in a team environment.

Community Additions