SQL Server From Squirrel’s View
Lockergnome
Home
Author Avatar

Documentation Header For Your Scripts

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!

What are your thoughts?

darren stanger - February 29, 2008 @ 2:51 pm

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

What do you think?

RSS feed for comments on this post · TrackBack URI

All Comments and Trackbacks are moderated (unless you're a registered user). Regardless, this page will refresh when your submission is entered.

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image