visual-studio-2012sql-server-data-toolsdacpacdata-tier-applications

Data Tools Database Project: Automatically Create Nice Folder Structure


When I import a DACPAC into a VS SS DT project, it creates a very nice folder structure for me: all my schemas are defined under a folder called "Security" and then each schema has its own named folder that contains folders called "Tables", "Stored Procedures", etc. However, if I right-click on the project name and select Add > Table, the new table is just added in the project's root. This doesn't seem right at all. Is there some way to get VS to honor the organized file structure that is created when I import a DACPAC?


Solution

  • I've found that the best way to deal with this is not make VS-side changes, but instead make SQL Server-side changes. After making the changes to the DB in question, I do a schema compare against the actual DB on the SQL Server, and the VS project. When I update against the diff, the nice structure is maintained.