Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard template in SQL Server Management Studio

I am working on a team that have a number of developers working with SQL Server, developing stored procedures, functions etc.

I would like a consistent layout between the SQL, same header with a copyright etc. SO I need a standard template for the SQL. I know in Visual Studio it is possible to share templates.

How can I generate such a template for SQL Server Management Studio that I can share between developers?

like image 733
amateur Avatar asked Jun 14 '26 05:06

amateur


2 Answers

This is how I do it:

  • the physical location of my template is in(Win7 SQL Server Management Studio 2012):

C:\Users\ys\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\Templates\Sql

  • I created my own folder in it (00_Mine)

  • Created a git repository

  • Asked other devs to pull from it.

like image 134
YS. Avatar answered Jun 16 '26 19:06

YS.


In SQL Server Management Studio, press Ctrl-Alt-T or go to Menu, View, Template Explorer

It will list all the templates. However, from SSMS, there is no easy way to add templates to it by drag and drop, you can create new ones and put them into a folder, such as _WORK_.

The templates live physically in (for 2008 R2): C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql, so you can simply drop files and folders in there or push out to team members using group policy. The templates are sorted alphabetically, hence the suggestion for _WORK_ above. Note: A restart of SSMS is required to pick up Template Folder changes.

Here's an article: Using SQL Server Templates

like image 35
RichardTheKiwi Avatar answered Jun 16 '26 19:06

RichardTheKiwi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!