Template Files (.TQL) in SQL Server to speed up documenation and for other benefits

Uniformity, Documentation using templates in SQL Server

Template is one nifty thing in SQL Server 2000. Well, if you have not had a chance to look at it, then please press CTRL+SHIFT+INSERT to launch the Insert Template Dialog , where in you can select one of the templates to be added to your SQL Code.

But, do these templates offer all that you need. They don’t seem to. The only reason being it varies on custom requirements. One such custom requirement is a Comment Template. Comment Templates can provide a uniform coding through the entire project as in the case of multiple people working on a common SQL Code.

So let’s put the above said statements into a tip that would benefit us by saving time and providing us the required uniformity.

To create a comment template, do the following:

1) Create a comment template as below:

            /************************************************************

            Name            : Name of the SP/Function/View/etc

            Parameters    : (Parameter List) [Parameter Data Type]

            Description    : Detailed description about the procedure

            Developer      : Developer's name

            Created Date : Procedure Created Date

            Change History

                        Modified By:    

                        Modified Date:

            Execution Script: Sample execution script

            ************************************************************/

2) Save this as a .TQL File in the templates folder under the SQL Server installation folder.

            e.g. C:\Program Files\Microsoft SQL Server\80\Tools\Templates\SQL Query Analyzer

3) So, whenever you need this section in your code, press CTRL+SHIFT +INSERT and select the .TQL file that you just created.

Thus, templates like these, provides easy facilitation of maintaining uniformity in the comments sections of the SQL code , especially when more than one Developer is working on a project.

By [)ia6l0 iii   Popularity  (994 Views)