O'Reilly logo

SQL Server MVP Deep Dives Vol. 2 by Kimberly Tripp, Paul Randal, Paul Nielsen, Brad McGehee, Greg Low, Louis Davidson, Kalen Delaney

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 27. Writing unit tests for Transact-SQL

Luciano Moreira

Unit testing is a known methodology among developers around the world, be they Java, C#, VB.NET, or C++ programmers. Unit testing helps you produce code with fewer bugs and achieve a higher degree of quality. Although this has become a well-known practice, when it comes to databases, we haven’t seen the same adoption rate.

The objective of this chapter is to introduce some basic concepts of unit testing that you can apply when programming with T-SQL, without using any third-party tool or external framework. I’ll show you how to make the necessary adjustments and bend some rules to adapt unit tests to databases.

Unit test basics

The primary goal of unit testing is to take the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required