Integrating ReadyRoll and tSQLt – Part 1

by data-centric on November 19, 2017

Having used RedGate’s SQL Source Control for many years, I have recently started using their ReadyRoll product. I like the idea of separating the tSQLt framework and tests into a different project (entirely separate from the application objects) and I also like the hybrid approach of using proper migrations for tables whilst still treating procedures, views and functions etc. as code. I am a huge fan of TDD for databases and in this post I talk about one way of integrating ReadyRoll and tSQLt – specifically setting up your development projects.

[click to continue…]

{ Comments on this entry are closed }

SQL Test Winners

by data-centric on November 30, 2012

I did promise to announce the winners of the SQL Test competition I ran recently on this blog.

I would like to thank Carol D for her excellent write up on her experiences. Carol gained a lot from trying her first code kata but especially the discipline of writing tests first for small pieces of functionality at a time.  Steve also made  another good contribution and describes the new experience of using TDD to write SQL.  The other winners were Alex, Arthur and Manoj.  Thanks to all the contributors for making it such an interesting discussion.

{ Comments on this entry are closed }

Unit Testing Databases with tSQLt Part 12 – Unit Testing Views

October 30, 2012

In Part 11, we delved into mocking stored procedures and explored how to populate output parameters or add a row to a table when faking a procedure. In this post, we will look at views, including writing tests against the views themselves and also how to mock a view that another object under test depends […]

Read the full article →

Improve Your Database Unit Testing Skills and Win Free Stuff

September 7, 2012

As the SQL Developer community grows to embrace the benefits of test-driven development for databases, so the importance of learning to do it properly increases. One way of learning effective TDD is by the use of code kata – short practice sessions that encourage test-first development in baby steps. Thanks to the guys at Red-Gate, […]

Read the full article →

Agile Database Development Training

August 31, 2012

I noticed recently that my friends, Dennis Lloyd (blog | twitter) and Sebastian Meine (blog | twitter) are running some one day workshops on TDD and agile practices in SQL to coincide with Red-Gate’s US SQL In the City tour.

Read the full article →

Code Kata for SQL – Toy Story

August 27, 2012

Practicing code kata is an established practice in agile shops but many kata are designed with object-oriented languages in mind and do not not always lend themselves to being reproduced in a declarative, set-based language like T-SQL.  So I have created this new kata specifically for SQL. Enjoy…

Read the full article →

Code Kata for SQL – FizzBuzz

August 2, 2012

There has been some discussion recently over on the Google Groups discussion forum for tSQLt about practicing code kata in SQL.  One suggestion was to try the time-honored FizzBuzz game and I present here a slightly modified version adapted to work with a non-object oriented, set-based language like SQL.

Read the full article →

T-SQL Tuesday #032 – A Day in the Life of a freelance Development DBA

July 17, 2012

This month’s T-SQL Tuesday is hosted by Erin Stellato (blog | twitter) with a theme of “A Day in The Life”. Erin talks about the fact that our job title is often not a real reflection of everything we do, sometimes not even anything we do.  So for this month’s blog party, Erin asks us […]

Read the full article →

Unit Testing Databases with tSQLt Part 11 – using SpyProcedure to control output parameters and other outcomes

July 12, 2012

In an earlier post in this series, I introduced tSQLt‘s [SpyProcedure] in a test to prove that one procedure calls another. In this article we delve deeper into mocking stored procedures and explore how to populate output parameters or add a row to a table without any of the intervening complex logic in the procedure […]

Read the full article →

From Hairdresser to DBA – How to start a career in IT

June 30, 2012

I left school more years ago than I care to count with minimal qualifications and more or less fell into a career in hairdressing.  I loved what I did for most of my time in that career but by 1999 had achieved everything I wanted to within that industry.  I decided it was time for […]

Read the full article →