Sql-server – SQL Server Management Studio 2012: How to have folders in the SSMS project

sql-server-2012ssms

I'm using SSMS 2012 to talk to the SQL server 2012 and Azure SQL servers we use. I admit I'm not a SQL expert so I've been saving most of my SQL scripts for future reference. I've quickly run into 20 or so .SQL scripts in the SSMS project and they are all living under the same 'Queries' folder.

Is there a way I can create "sub-folders" in the project so I can organize my scripts properly? How do most other folks keep their scripts organized? I'm pretty sure if this bugs a novice like me, it must be a real issue for real admin (with potentially hundreds of scripts?)

Best Answer

Finally, subfolders were made possible in SSMS 2016.

Cautious users: You can install SSMS 2016 and still keep using old one. See note [1] below.

Once there, start using solutions instead of projects.


Subfoldering works like this:

Adding solution subfolder:

  1. Right-click solution item (tree root) and from menu select Add > New Solution Folder.
  2. Step 1 now works also on any folder you added.

Adding SQL script:

  • Right-click any folder and from its Add menu, either add existing SQL file or new SQL file (in the list, find item type which has SQL extension).

Your Good old projects (Bad old projects)

  • You can still host projects in your solution if you see them beneficial for some legacy reasons, for hosting connections, etc. Just add new or import existing projects into the solution.

[1] Regarding upgrading:

  1. SQL Server 2008 - 2016 are officially supported by SSMS 2016. See more information at download page. For older versions, you can keep your favourite old SSMS, see point 2 below.

    • the only setting which might require your attention is Options > SQL Server Object Explorer > Script for server version > (set your server version)
  2. Different SSMS versions live well together, i.e. you can have SSMS 2008 and SSMS 2016 installed together without issues – tested.