Friday, August 05, 2016

SSMS and storing templates in a different location

In Sql Server Management Studio (SSMS), there doesnt seem to be a way to store the templates in a location other than the default (which is: %appData%\Microsoft\SQL Server Management Studio\12.0\Templates\Sql). I use this feature heavily, but everytime I get a new computer, I end up loosing them templates that I have collected over time.

I found a simple solution around this and it uses the “mklink” command.


1. Open a command prompt and CD to: “%appData%\Microsoft\SQL Server Management Studio\12.0\Templates\Sql”

2. Run the command:

mklink /D MyTemplates C:\OneDrive\SqlTemplates

The above command creates a link from within the folder that SSMS looks for templates to a folder on c drive (I am mapping it to folder thats backed up by one-drive).

3. Restart SSMS, and voila, you should see this folder in your templates explorer.

1 comment:

Raj Rao said...

To delete or clean up all the existing templates, you need to to the cleanup in 2 locations:

%programfiles(x86)%\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\SqlWorkbenchProjectItems


%appData%\Microsoft\SQL Server Management Studio\13.0\Templates\Sql