Unit Testing Databases with tSQLt Part 2 – testing table structure

October 19, 2011

In Part 1, I worked through setting up the tSQLt unit testing framework in a development database for the first time. In this post, we are going to start writing our first tests for the first piece of functionality to be implemented in Log4TSql which is an open source database logging and exception handling block […]

Read the full article →

Unit Testing Databases with tSQLt Part 1 – Installation and Setup

October 13, 2011

This is the first in a series of articles about my experiences (re)creating a database project from scratch using the tSQLt unit testing framework. I will be using an open source project I have been playing with on and off for a few years – Log4TSql which is an open source database logging and exception […]

Read the full article →

Test Driven Development (TDD) for Databases – Choosing a framework

October 8, 2011

I’ve been a fan of test-driven development (TDD) for a long time. My primary skill set revolves around database design and development but I like to think that, whilst not a .Net expert, I have pretty good C# skills for a SQL bod. So I have had the opportunity to follow proper TDD methodolgies on several […]

Read the full article →

Making RAISERROR work like PRINT

December 10, 2010

One of my favourite bloggers, Brent Ozar posted recently on his favourite blog posts one of which was a really good article by Kendra Little on reasons to use RAISERROR instead of PRINT statements. The synopsis of Kendra’s post was that whilst we all learn early on in our development careers to use PRINT statements to debug […]

Read the full article →

Unit Testing with Visual Studio DB Pro Part 2

November 21, 2010

In Part 1, I talked about some of the challenges associated with writing effective database unit tests and in Part 2, we will work through setting up a new database test project in Visual Studio 2008 then writing and passing our first unit test. If you’re reading this I will assume you know about some of […]

Read the full article →

Storing Single Key/Value Settings

November 16, 2010

I read an interesting post today by Arnie Rowland about a simple but clever way to ensure only one row in a table used for application settings or config items. I have found that tables like this can, if allowed to go unchecked, proliferate through a database which can cause minor, niggling maintenance issues and […]

Read the full article →

Unit Testing Databases with Visual Studio Part 1

November 14, 2010

I’m a big fan of the benefits of test-driven development (TDD) and similar methods. Having a suite of unit tests that can be easily or automatically re-run gives me greater confidence in the quality of the software I produce and means that I spend less time debugging both during initial development and during any subsequent […]

Read the full article →

Configuration system failed to initialize

November 13, 2010

I recently needed to change the root namespaces on a solution, I know this something that I should have perhaps thought out in more detail before getting so far in to the project but that’s not the point of this post. I stand to be corrected, but there doesn’t seem to be a way of […]

Read the full article →

Finding Dependencies in SQL Server

November 9, 2010

I think that anyone who has used the system stored procedure sp_depends to find dependencies in SQL Server will have discovered  that the results cannot always be relied upon.  Most notably, this can occur when modules (procedures, views etc) have been created out of dependency order.  It seems that SQL Server only populates sys.depends values […]

Read the full article →

Why am I here?

November 3, 2010

I suppose it’s traditional to start a new blog off with a “why am I here/what is this blog about” type post, so here goes… fast access cash I have worked in IT for almost eleven years, and have focussed on databases and SQL Server for ten of those. Like most seasoned professionals, I have […]

Read the full article →