Lemiffe Music, Software & Stories

Documenting Stored Procedures

I’ve been creating and modifying a few stored procedures for a ‘debt history and future payments’ report in a VS.NET app using SQL Server 2005 for the past days. Quite a bit of a task to be honest, but I have found something very useful while developing large stored procedures. Some times they can get out of hand, you know, with virtual tables, views, massive calculations involving aggregate functions and loads of inner joins.

Document everything! Changes, current status, this way you’ll have a clue on where you stand and what you must achieve, so even if things get out of hand this is always a good reference, and gives you a great focus. It’s also a very good guide when you finished it, and several months later your customer calls you nagging that it’s not working anymore. You go back, read all you wrote, and get a full view on it’s current status and what you must do to correct the mistakes.

An example of my style of documenting stored procedures is as follows:

/*###########################

Stored Procedure:	[NAME]
Main Author:		Persons Name
Modifications:		Person, Person, Person
Current State:		Not Working
Parameters:		@idcatalog: Catalog ID
			@parameter1: Description
			@parameter2: Description
Test Parameters:	1, 100, 2044

General Info:		This stored procedure does this
			and that and something else,
			unfortunately it does not work
			because it is missing this and
			that and something else.

LOG:	28.07.2008	SP created with initial values. (Me)
	29.07.2008	Parameter 2 added for +reason. (You)

###########################*/

You’ll notice a good improvement in programming time per stored procedure even though it takes you a mintue or two to write it down. It’ll help you out quite a lot in the future, you’ll see.

2 Compo Entries

Here are my entries for 2 composition contest’s that were held yesterday on the Mod_Shrine, unfortunately I got last place in both, but in the end… it’s music, and it’s shareable :) You need a tracker that supports .IT files to play it, or modplug player. Download MPP here.

The Genuine Sound of Vomit

The spasm

(Right click and save these files to your PC to listen, it won’t stream off the internet).

Hello World

Welcome.

I’m going to try and write regularly about stuff that comes to my head, lyrics, maybe a few poems once in a while, political thoughts, food for the brain, and whatever else comes to me. Not because I think I’m an interesting person or anything, but because I think we all should have some place to express a few of our thoughts, it sometimes makes life more interesting ;)

Arbitrary text of the day: “This will locate the customer based on the number you entered in the first text box”.