Archive for the ‘Data’ Category

British Government launches free data site

Just a quick post about the British Governments launch of offering free access to a large number of datasets. It’s good to see this data, that we as taxpayers have funded, available for free use. Hats off to The Guardian’s long running free our data campaign. The site is being officially launched by Sir […]

Primary Keys do not always have to be ‘Id’!

We’ve all more than likely spotted tables in databases with no primary keys. But does a primary key always have to be defined something like… ALTER TABLE MyTable ADD Id INTEGER NOT NULL IDENTITY(1,1) PRIMARY KEY CLUSTERED; I think we have ORM to blame for this widespread practice of using auto-incrementing integers as PK’s. In […]

London Postcode District Data

The requirement to work with postcodes, and specifically London postcode districts, has followed me around during my professional life. Below is a TSQL script to create a table for the postal districts in London. Enjoy! CREATE TABLE london_postcodes (postcode VARCHAR(4) NOT NULL PRIMARY KEY CLUSTERED) GO SET NOCOUNT ON; SET XACT_ABORT ON; GO BEGIN TRANSACTION; […]