E-Mail:
Get our new Windows 7 eBook (PDF) for $7 with 70+ Tips. Download Now!

Documentation Header For Your Scripts

  • No Related Post

Hello there!

I thought today I would share with you the documentation header that I use for my T-SQL scripts. The header has evolved from the days of just the name of the script, the author and the date. Through my years of experience I have made the header more descriptive and always looking to improve it. The header has saved me lots of time from searching through my T-SQL code to see if a particular stored procedure is called, user defined function, etc. Here is the documentation header I use:

/*
**********************************************************************
**
** Object Name: < Object Name>
** Object Type: < Stored Procedure, User Defined Function, etc. >
** File Name: < Name of the file.. normally followed by .sql >
** Database Name: < The name of the database the object will reside in >
** Author: < Name of the person who wrote the T-SQL script >
** Creation Date: < Date the T-SQL script was created with ANSI date >
** Description: < Detailed description of what the script does >
** Special Note: < Any special remarks about the script >
** Modified Tables: < List tables that the data is modified by this script >

** Called Procedures < List procedures that this script calls >
** Called Jobs: < List SQL Agent jobs that this script calls >
** Called UDFs: < List user defined functions that this script calls >
** Calling Procedures: < List procedures that call this script >

** Calling Jobs: < List SQL Agent jobs that call this script >
** Calling UDFs: < List User Defined Functions that call this script >
** Return Statuses: < List return status that this script returns >
**
**********************************************************************
*/

If you would like to suggest adding something more to the document header please comment!

7 Comments

Your documentation header is very helpful. I added some things and turned it into a template for use with SSMS’ feature to fill in template parameters:

/*
**********************************************************************
**
** Object Name:
** Object Type:
** File Name:

** Database Name:
** Server:

** Author:

** Sponsor:

** Creation Date:

** Description:
** Special Note:

** Modified Tables:

** Called Procedures:
** Called Jobs:
** Called UDFs:

** Calling Procedures:
** Calling Jobs:
** Calling UDFs:

** Return Statuses:

** PRIVACY NOTES:
**
**********************************************************************
*/

Thanks again.
Darren Stanger

Very interesting site, Hope it will always be alive!

Hope it will always be alive

What Do You Think?

 

Posted Recently

35 queries / 0.152 seconds.