Home Dashboard Directory Help
Search

Add support for the full folder structure from Database Projects into SSDT by Mark Freeman


Status: 

Active


3
0
Sign in
to vote
Type: Suggestion
ID: 775510
Opened: 12/31/2012 11:23:50 AM
Access Restriction: Public
0
Workaround(s)
view

Description

I invoked Project | Import | Script, selected a .sql file that I had exported from DTA, but found no override option. (See note regarding this missing UI element from Gert Drapers in http://social.msdn.microsoft.com/Forums/en/ssdt/thread/531d22dc-cdaf-4788-8220-3fad91eef8f0). Although there is a drop down for "Folder Structure", the option "Schema\Object Type" does not do what I am used to from Database Projects.

Instead of creating new files under Schema Objects\Tables\Statistics, it appended the CREATE STATISTICS statements to the existing CREATE TABLE scripts in Schema Objects\Tables. Just as I don't want the constraints and keys in my table definition, I don't want the statistics there either. This creates inconsistencies with the way that the project scripts were created and maintained in the Database Projects before SSDT "replaced" those. If I want to look in my source code to find the statistics, I don't want to have to open each CREATE TABLE script. I want to be able to expand the Schema Objects\Tables\Statistics tree in Solution Explorer.

When SSDT "upgraded" my Database Projects, it did not consolidate the existing Constraints, Keys, or Statistics scripts into the Tables scripts. It is therefore unexpected that the Schema Comparison and Import Scripts executions only update Tables scripts and do not create or maintain the more specific script types.

Meanwhile, I am not looking forward to having to create around 100 CREATE statistics scripts without assistance from a tool. I realize that I can write my own Powershell script to parse the DTA-produced .sql file into individual CREATE STATISTICS scripts, then use "Add Items to Folder" in Source Control Explorer, and add use "Add Existing Item..." to add them to my Project, but this seems like a lot of work that should be done for me. And the Database Projects feature that SSDT superseded used to do all that for me.
Details
Sign in to post a comment.
Posted by dejan1 on 7/17/2013 at 10:20 PM
Hi,
This is a major annoyance. Creating objects in SQL Object Explorer creates them in root project folder in Solution Explorer. But when import is used, folder structures are created.
This is inconsistent.
Also, having a standardized folder structure is a great feature. It was working well in VS 2010, why partially remove it in 2012?
Dejan
Posted by Microsoft on 1/17/2013 at 10:46 AM
Thank you for the input. We will consider this for a future version of SSDT.
Sign in to post a workaround.