SQL Server example of datetime and datetime2

Mapping C# DateTime to SQL Server datetime2 via SSIS

With SQL Server 2008, Microsoft introduced the new, improved datetime2 format.  This newer time storage format is great, because it takes up less storage space, plus you have control over precision and can define your field to the exact specification required.  Database columns defined as datetime2 can be mapped in SSIS by using the DT_DBTIMESTAMP2 type.  However, in the scenario where you may have a Script Transformation in your SSIS package, and want to assign a .NET DateTime type to a Data Flow column that is mapped to a datetime2 field, you might encounter a DoesNotFitBufferException.

The reason for this is likely down to your specified field precision, and is easily fixed. Continue reading “Mapping C# DateTime to SQL Server datetime2 via SSIS” »

Case sensitivity in SSIS Lookup Transformation

Something that catches out a lot of new SSIS developers.  The caching mode used for a Lookup Transformation may affect case sensitivity.

The Full Cache option is case sensitive by default.  Partial and No-cache options use the Collation setting of the database (or table) to handle case.

Of course, using Partial or No-caching results in the SSIS package issuing a call to the database for each row in the data flow, so use them wisely!

Network graph visualising Man City vs Bolton by Eigenvector Centrality

Visualising a football match as a Network Graph using Gephi

Ever since getting my hands on some Opta data, courtesy of Manchester City’s Analytics challenge all the way back in August 2012, I’ve been wanting to try something different with the data.  Although it’s taken me over a year to get around to doing it, I’d initially thought of the idea of doing some kind of Network Graph to explore how the players were interconnected throughout a match, and potentially over an entire season.  Since starting to play with Gephi some time ago, I figured it would be perfect for the job. Continue reading “Visualising a football match as a Network Graph using Gephi” »

Lego NAS enclosure for Raspberry Pi

Building a Raspberry Pi NAS: Enclosure

Lately I’ve been experimenting with the Raspberry Pi, the credit-card sized budget computer that took the world by storm back in 2012.  I posted the other day about the hardware I’m using to create my own, Raspberry Pi based NAS (Network Attached Storage) slash backup server slash media centre.  I mentioned at the end of that article about buying or creating an enclosure to tidy up the Pi-based solution, as well as keep all the components safe and together.  It’s not entirely necessary, but if you have a Raspberry Pi, one or two external HDDs, a USB hub and HDMI/Ethernet cables, chances are it’ll be messy and you’ll want to build or buy something to keep everything together all neat and tidy.  There are lots of possibilities out there, some you can buy, others you can make.  There are lots of cases for the Pi itself, but I needed one to match my particular setup and contain the hard drives, USB hub, and all the related cabling as well. Continue reading “Building a Raspberry Pi NAS: Enclosure” »

Raspberry Pi Model B Starter Kit

Building a Raspberry Pi NAS: Hardware

The Raspberry Pi has been a huge hit since its launch in 2012, grabbing the attention of hobbyists and professionals alike.  The option to buy a fully functional, credit-card sized computer for less than £30 has opened up a slew of possibilities for experimentation and creativity, regardless of budget.  I’d been meaning to pick one up for a while, and finally got the push I needed when I started doing some freelance web work and needed a backup system for my client sites and databases.  Reading Scott Hanselman’s post regarding the Computer Backup Rule of Three simply drove home the point.  I also fancied getting all my media files off my hard drive and into a centralised location on my home network where they could be backed up, easily accessible, and viewed through my TV.  Given the option of buying a pre-made NAS box from Amazon, or constructing my own and getting my teeth into that tasty Raspberry Pi, there was no choice to be made! Continue reading “Building a Raspberry Pi NAS: Hardware” »