I made progress by manually editing the SSMS project file to add folders underneath the solution.
Open the .ssmssqlproj file in a text editor.
Search for the nodes called LogicalFolder. The Miscellaneous node is a good model for what you need to do.
Just copy these lines and change the name to the folder you want to see. Also change the Type value to something unique. Here is what I did.
<LogicalFolder Name="Tables" Type="4" Sorted="true">
<Items />
</LogicalFolder>
<LogicalFolder Name="Functions" Type="6" Sorted="true">
<Items />
</LogicalFolder>
<LogicalFolder Name="User-defined Table Types" Type="7" Sorted="true">
<Items />
</LogicalFolder>
MAKE SURE TO KEEP A COPY OF THE PROJECT FILE (.ssmssqlproj). If you mess up the editing, as I did a few times, the project will not open. This won't be so bad if you have installed the TFS add-in and are checking in your project files - you can just discard the changes. But if not, make sure you make a copy.
Then I create folders under the solution to match the logical folder names. After that I created a table definition script and a user-defined table type definition script, and saved them in their respective folders. They showed up under the "Miscellaneous" folder in the solution explorer, so I dragged them to the appropriate folders.
This is where things broke down. Because, I think, all of the stored procedures, functions, table, and type are in files that have a .sql extension. Because the are .sql files, they were placed under the Queries folder in solution explorer. However, they are still physically in the right folders on disk. So that is a step in the right direction.
I want to see if the "Type" attribute in the project file corresponds with a specific file extension, and if I can figure out what those are. If I can get the right extensions then SSMS will place the files in the right project folder.
I may look at Visual Studio to see how that works, since SSMS is based on Visual Studio, according to their splash screen.
However, I am partway there, so maybe one of you can figure out the rest!
.sql
file. That way you only ever have to keep track of the one file. – Hannah Vernon♦ Nov 22 '12 at 20:57