Top 5 Tips for Script Writing

Due to the nature of my job a lot of script writing (SQL in my case) is done on the fly and is often written in an ad hoc fashion. This is fine for my personal use (that is until I look back an indeterminate time later and have to decipher my own work whilst trying to remember my reasoning) but if a bus that has my name on it were ever to strike me down my successors would undoubtedly struggle with some of my scripts. So, here are my top 5 tips on how to check and maintain the integrity of scripts and to make them accessible for other people to read, run and adapt if necessary.   1.…