Earlier this month, I presented a webcast on the “Underappreciated features of Microsoft SQL Server” during the “Exclusive Webcast series on Microsoft SQL Server”. As one of the developer productivity features provided with the SSMS, I presented the Template Explorer.
The session received a very good reception, and I thank-you – the community for the same. After the session, we had a very nice round of Q&A, and I was asked a very interesting question – “How can I deploy a template to all of my developer workstations?”
It’s a very interesting question, and you would need the help of your IT Administrator for the same. However, here are the high-level steps to do so.
NOTE: These steps are formulated for Microsoft SQL Server 2008/2008 R2. Depending upon your version of SQL Server, the paths referenced may change.
- Login to SQL Server Management Studio
- Go to View->Template Explorer or hit Ctrl+Alt+T
- Customize the template of your choice or create a new one by using the method described in my post – http://beyondrelational.com/blogs/nakul/archive/2011/01/24/template-explorer-underappreciated-features-of-microsoft-sql-server.aspx
- Navigate out to the location: %APPDATA%MicrosoftMicrosoft SQL Server100ToolsShellTemplates
- Notice that the newly created template is stored as a .sql file under the category chosen. Thus, if you developed a template for a T-SQL Stored procedure, you will find it under ..SqlStored Procedure
- All that needs to be done now is to copy this template over to the same location on the target machine. Thus, if you have a team of 10 developer machines, all you need to do is to make sure that the template is placed at the mentioned path for each of these 10 developer machines
Typically, deployment of the custom template to the %APPDATA% folder hierarchy on the destination machine can be handled via a logon script by your IT administrator.
Do let me know if the above mentioned steps helped you roll out custom templates confirming to your coding standards across your team.
Until we meet next time,
Be courteous. Drive responsibly.