gitSQL – Source Control for SQL Server

TLTR: How to export SQL Server objects and data to flat file for version control. A blog post behind the gitSQL tool, why it came about and the journey so far.


Problem – I need to source control my database

Earlier this year I was thinking about how to automate the extraction of SQL objects and data from SQL Server into flat file. I wanted to do this so I could save the files to GIT and then track changes.

I also wanted a bit more than that too – i wanted to be able to build a database from source control.

I don’t ask for much right?


I searched and searched and found the following products on the market.


Liquibase is free – but I couldn’t manage to configure it to my requirements. If i did manage then this blog post wouldn’t exist.

I tried each of the other products and they all felt good – but only if you are willing to spend between $200 – $1000.

I didn’t want to spend any money, or at least, I could not justify spending any money right now.

I then set on it to distill the very essence of what these apps were offering and what is going on underneath the hood.

What did I do next?

You probably guessed it –

I created my own App, and launched it in April this year  as

My main reason for creating the app was because I wanted something simple for myself and I thought it would be great to share it;

gitSQL has 3 screens and a command line interface coming in the next release.

The CLI will help with continuous automation, and general streamlining of source control.

gitSQL is Free for up to 20 tables, and 10 other objects, with an UNLIMITED version @ $40.

At first, I didn’t want to charge anything for it but I soon realised that I would need to support the app with potential bug fixes and future features.

Therefore – the UNLIMITED licence is simply to cover development costs and hosting costs.

Any happy customers?

One of my early customers had a fantastic experience with the product, so much so that he kindly blogged about his experience.

Read all about it:

I have also had a lot of direct messages on Facebook and Twitter asking about current features and CLI options for the future – This is really rewarding for me because it means that gitSQL is working for others like I thought it might do. #success

I also had a request for adding Sequences as an object type – through gitHub, and after a bit of testing i worked out it could be added and it’s made it into the latest release. #github issue 4

What’s next?

I would really like to include a PostgreSQL, MySQL and maybe an Oracle version(s) of gitSQL to make a more comprehensive suite of source control apps.

I am currently working on the PostgreSQL version which should be released Q2 2016. The MySQL version may also be released at the same time if I can engineer things correctly. The end result may be one app for them all – or several individual apps bundled into one single download. #not_decided_yet

The future products will follow the same model of being fully featured for FREE, with a small licence cost for UNLIMITED usage (again just to cover my development/hosting/support costs).

I hope gitSQL works for you – and if it doesn’t please let me know over at gitHub, Facebook or Twitter.

Sick of coding? … Try growing veg!

So what happened?

Year before last – i found myself looking at an overgrown plot at my local allotments.

My immediate thought was – wow, this would be hard work if i took it on and it would probably take me away from my coding projects… but i went ahead an rented the plot anyway.

I’m now in year 2 of having the plot and I’ve also had a baby boy, my sister’s wedding and a house move in between.

Surprisingly, I’ve managed to get more throughput on my coding projects that I had previously?

Doesn’t make sense right?

I love spending time at the allotments, it’s hard work, i build up a sweat and the results take a long time to come, but there is a clear process to success.

  1. Clear the ground
  2. Sow seeds (greenhouse or ground)
  3. Remove weeds
  4. Add nutrients
  5. Crop

What does this have to do with coding?

1. Clear the ground

I find myself clearing up coding environments, setting up GIT, a database, so on and so forth before I start a new project. Some aspects are automated but essentially what I am doing is clearing the ground.

2. Sow seeds

Most of my code visualization is done away from the computer, when I’m in the shower, driving around, washing up or at the allotments. I find this to be the key to a successful coding session at the computer. Visualization is the key word here, because when I plant seeds at the allotments, i may not see any sprout for a week or so – but i have the plant visualized in my head. I liken this to writing classes in code which have functions that do not do anything yet but they are there to help visualize the end product.

3. Remove weeds

Software needs weeding time to time, by which I mean, re-factoring and debugging. Sometimes – early on, i find myself re-writing code just so I can engineer it in such a way that it can be used for other projects. Sometimes I don’t if i know it’s not going to be used again, but in any case, I have to approach the coding session as if I’m going to remove weeds.

4. Add nutrients

In the gardening context, soil needs nutrients and sun and water. These are the basic requirements.

In the coding context, the human requires nutrients in order to produce quality code. We are not machines, and it’s important to remember that. It’s also good to know our optimal time in the day when we are at our coding best.

In the code base context, nutrients usually come in the form of inspiration from other projects, integration with other code bases and collaboration with other coders.

5. Crop

Cropping in the software sense is knowing when a product is ready for release. It’s as simple as that.
We have to go through some test phases and make sure the product does what it’s suppose to do – i liken it to testing a tomato firmness, or peeling a bean pod to see the contents.

How did I get more throughput on my coding?

I made my sessions count!

Baby duties, wedding planning, moving house, going to work, going to gym, spending time with family and friends… that’s all important to me, so I had to make sure that when I allocated time for coding, it really had to count, because i knew i may not get that window again for several days.

Make it count!



Website Design Trends 2010 / 2011?

Website trends have stabilised over the years thanks to companies such google, wikipedia, amazon and facebook to name a few.

Web developers, designers and users are generally more aware of user interface design – what works and what doesn’t?

Here are a few examples of websites which I have found that seem to follow a ‘trend’.



BBC Website



ebuyer Website



Xfactor Website

Sunday Times

The Sunday Times

The Sunday Times Website

Royal Mail


Royal Mail Website

Tesco Direct


Tesco Direct Website

BBC iPlayer


BBC iPlayer Website

What do they have in common?

1) Oversized animated header

2) Large typography for website headings

3) Column grid design for the entire website (as used by newspaper editors such as The Sunday Times)

4) Oversized footer section which contains a sitemap

5) Search bar located at the top right

It seems to me that a lot of websites are adopting the oversized footer section of the website as their navigation area. BBC and ITV both have oversized footer sections which contain links through to internal pages. The links are displayed in columns which can be read quickly by the reader (Pacing). Is it easier for the visitor to see links on the footer?

Wikipedia recently completed a usability study which showed that the search bar located at the top right was the most intuitive place that a user would look for when searching a website. (See their explanation here). We can see that the BBC and Sunday Times websites have search bars at the top right of their websites. Does this mean that we should be putting search bars at the top right?

Oversized animated headers seem popular too – as the content of the header changes with a transiation. In a way – this shows the visitor more content during their visit without them having to click anywhere. This has got to be a plus? no? Especially if a visitor only stays for a few seconds. Are oversized, animated headers better than static headings?

Typography on websites have become extremely popular over recent years- especially with designers. I imagine this is because website developers now have the tools available to place designer typography onto websites. Text replacement seems common on some websites as a means of adopting dynamic typography driven by CMS. Is this better practice than using web fonts?


… do I need to say any more?

Most of my google analytics statistics show that the average website visitor will leave a website on the homepage – without ever clicking through onto other pages.

Hmm – maybe I need to make better websites? *gulp*

Saying that – I imagine this is a general issue with all websites with respects to converting visitors. There’s an old analogy I like to use.

We normally have to head out to the grocery store to get bread and milk. Supermarkets place their milk and bread at the back of the store so we have to go past everything else first. If we’re not on our guard we reach the checkout with several items along with the milk.

A good website will “Give them Milk”… – a reason to come back.

Perhaps we need to be giving users familiar design (like the supermarkets do)

What do you think?

Stripslashes in SQL for MYSQL and ORACLE


Today, I wanted to strip slashes from a comment field using SQL (INSTEAD of using php stripslashes).

Why you ask?

I was working on an application which had not considered stripslashes for formatting output.

So I had a look and realised. Do I change 40,000 lines of code to add Stripslashes, or 1 line at the SQL select statement?

OK, slight exaggeration, but you get what I mean.



[sourcecode language=’sql’]
Replace(field_name, ‘\\’, ”) as stripped_field


[sourcecode language=’sql’]
Replace(field_name, ‘\’, ”) as stripped_field


If using in PHP add an extra backslash like this;

[sourcecode language=’sql’]
// strip slashes as part of the SQL select statement
$sql = “Select Replace(field_name, ‘\\\’, ”) as stripped_field from table”;

Please get in touch if you know of an easier way to do this, for example, Oracle Functions, or MySQL functions.

Many thanks and happy coding.

I remember the days before ADODB

I remember a time when SQL was written for a database.

Oracle SQL was different to Access SQL

mySQL was different to SQL Server SQL

… then somebody said no, stop, enough is enough.

Sometime in 2009 ADODB was born for PHP. The 1 wrapper for ALL database types. Ah, just what we wanted.

Wait a minute? This is ADO, didn’t microsoft do this in 1996? The short answer is yes. Database abstracting is old in theory, tried out by microsoft, worked to a degree but never fully made it in the world (for whatever reason).

This brings us up to ADODB  – the promise of a database wrapper that will make it through, and iron out the issues that microsofts offering had.

Today I got my hands dirty with ADODB and I liked it. Looks and feels just like any other wrapper such as ADO.

Actually, I think it’s the same same. So so… così così.

One thing for sure. It makes hot swapping between Oracle/MySQL (which is what i’m doing right now) a breeze.

That’s why i’m writing about it.

I like it… how about you?

PRE tags, the quick way to keep formatting

I get asked quite often if there is a way to show CODE on a website, with it’s formatting in place?

The short answer is <pre>

It can output free text (i.e. non server side code) in a pre-formatted way. Yep, PRE = Pre-formatted.

On top of that, Preformatted also renders the php print_r() output in a nicely nested unordered list, which is great for debug purposes;

[sourcecode language=’php’]  echo “

";    print_r($arr);  echo "

“; [/sourcecode]

I am sure there are other uses for the <pre> tag too, I have just scratched the surface.

Give it a go – let me know if you find other uses for it.


BCC – Blind Carbon Copy – The forgotten field!

The BCC field can usually be found underneath the CC field.

Sound’s obvious right?

You already know about the field, yes?


— but not everyone knows about it, or how to use it. I say this because I have had emails sent to me where ALL the contacts have been in the To: field.

This is bad practice because;

1) It violates the data protection act (we didn’t give permission for our email address to be shared)

2) Looks unprofessional

3) Opens us up to spam!

Whenever I get an email like this, it is usually because the person sending it is inexperienced/hasn’t had the training in proper use of email. So for those who use the BCC field correctly well done. For everyone else, please learn.

For MASS email, please enter ALL your to contacts into the BCC field, and then add your own address to the TO field. This way, ALL emails will appear to be sent to yourself, with blind carbon copies going off to everyone else.

Happy emailing.

In Sky Design – Website Launch

“I’ve opened up a web design business”

After many years of freelance web development, I decided to bite the bullet and “open up shop”.

In Sky Design is an association of designers and developers working together to create user friendly websites. We offer web design, graphic design and web application development; for start up business and established businesses who need internet solutions.

Please take a look at

We have set packages along with a price guide to show what our customers most commonly ask for.

If you can’t find it on the website, no problem, please ask.

Vista Compatibility Mode

Here’s a nice neat trick to get Windows XP application to work in VISTA.

[sourcecode language=’bash’][HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]”$path”=”WINXPSP2″[/sourcecode]

Replace $path with the absolute path to your program;

[sourcecode language=’bash’]
c:\\program files\\myapp\\myapp.exe

Make sure you add double back slashes.

Stop the Microsoft Office 2007 Logo / toolbar / ribbon from blinking / flashing

The Issue Microsoft Office 2007 has a wonderful new interface with ribbons, which other developers are adopting as a windows standard. However, when office is installed and used for the first time, the Microsoft Logo (shown below) flashes until the user clicks it.

Microsoft Flashing Logo

So what’s the problem?

I have been using the Microsoft Access 2007 object in Visual Basic at work, and attempting to open an instance of Access as hidden. The issue comes up when we distributing the application that we have created.

When the user installs Access 2007 – Run Time Edition, and then runs our application, the Access Window pops up, with the flashing logo.

How do I stop it from flashing?

This is the million dollar question that I’ve been trying so hard to find the answer to.

– Brielfly, I ran a registry comparison tool (RegFormApp) to see what happens when the user clicks on the microsoft logo in an office program.

The program showed that the following registry key was being updated.

[sourcecode language=’bash’] [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General]

Okay, for those of you who use windows registry edit, follow the following steps;

How to change the setting

1) Navigate through the tree menu on the left, until you get to the right place.

2) Double click on “OfficeMenuDiscovered”.

3) Change the setting from 0 to 1. Click OK to save the changes.

The .REG File Method
Stick the following into notepad, and then save the file as a .reg extention.

[sourcecode language=’bash’][HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General]

This will make it into a Registry update file that you can use in installers, etc, to get the setting set!

All I can say is that it’s been a journey.

I hope this post saves you a lot of time and effort in your developments.