Click here to monitor SSC

Alex Kuznetsov Alex Kuznetsov

Alex Kuznetsov has been working with object oriented languages and databases for more than a decade. He has worked with Sybase, SQL Server, Oracle and DB2. He regularly blogs on sqlblog.com, mostly about database unit testing, defensive programming, and query optimization. Alex has published multiple articles on simple-talk.com and devx.com and wrote a book entitled "Defensive Database Programming with SQL Server". Currently he works with DRW Trading Group in Chicago, where he leads a team of developers, practicing agile development, defensive programming, and database unit testing every day. In his leisure time Alex prepares for and runs ultramarathons.

Close Those Loopholes: Lessons learned from Unit Testing T-SQL
by Alex Kuznetsov | 09 January 2012 |  5 comments |
Alex has done some pioneering work on the testing of stored procedures over four years, and has learned a great deal in the process. In this article, he spells out the lessons learned from a wealth of experience in Unit Testing T-SQL. Read more...
Yet Another SQL Strategy for Versioned Data
by Alex Kuznetsov | 22 June 2011 |  14 comments |
There is a popular design for a database that requires a built-in audit-trail of amendments and additions, where data is never deleted, but merely superseded by a later version. Whilst this is conceptually simple, it has always made for complicated SQL for reporting... Read more...
Tuning SQL Queries with the Help of Constraints
by Alex Kuznetsov | 07 December 2010 |  5 comments |
The use of constraints is a valuable way of improving query performance as well as maintaining the integrity of the data, but this is, inevitably, a trade-off: The data uses up more storage, and the modifications are slower and more difficult. In SQL Programming,... Read more...
Modifying Contiguous Time Periods in a History Table
by Alex Kuznetsov | 25 November 2010 |
Alex Kuznetsov is credited with a clever technique for creating a history table for SQL that is designed to store contiguous time periods and check that these time periods really are contiguous, using nothing but constraints. This is now increasingly useful with the... Read more...
Defensive Error Handling
by Alex Kuznetsov | 28 October 2010 |  1 comment |
TRY…CATCH error handling in SQL Server has certain limitations and inconsistencies that will trap the unwary developer, used to the more feature-rich error handling of client-side languages such as C# and Java. In this article, abstracted from his excellent new... Read more...
Developing Modifications that Survive Concurrency
by Alex Kuznetsov | 22 June 2010 |  9 comments |
You can create a database under the assumption that SQL looks after all the problems of concurrency. It will probably work fine under test conditions: Then, in the production environment, it starts losing data in subtle ways that defy repetition. It is every... Read more...
Basic Defensive Database Programming Techniques
by Alex Kuznetsov | 31 March 2010 |  2 comments |
We can all recognise good-quality database code: It doesn't break with every change in the server's configuration, or on upgrade. It isn't affected by concurrent usage, or high workload. In an extract from his forthcoming book, Alex explains just how to go about... Read more...
Defensive Database Programming
by Alex Kuznetsov | 22 February 2010 |  3 comments |
Inside this book, you will find dozens of practical, defensive programming techniques that will improve the quality of your T-SQL code and increase its resilience and robustness. Read more...
Brain Teaser for Pi Day
by Alex Kuznetsov | 02 March 2009 |  12 comments |
Alex has come up with a great idea for Pi Day. We should celebrate by trying to come up with a way, in SQL, of generating a an accurate value for Pi. If only Archimedes had possessed a laptop, his work would have been easier! Read more...
Close these Loopholes - Reproduce Database Errors
by Alex Kuznetsov | 23 May 2008 |  3 comments |
This is the final part of Alex's ground-breaking series on unit-testing Transact-SQL code. Here, he shows how you can test the way that your application handles database-related errors such as constraint-violations or deadlocks. With a properly-constructed... Read more...
The Case of the Skewed Totals
by Alex Kuznetsov | 15 April 2008 |  4 comments |
Even when your code tests out perfectly in the standard test cell, you can experience errors in the real production setting where several processes are hitting the database at once, in unpredictable ways. You shouldn’t, of course, let it get that far, because... Read more...
Close Those Loopholes: Stress-Test those Stored Procedures
by Alex Kuznetsov | 03 February 2008 |  9 comments |
You can write a stored procedure that tests perfectly in your regression tests. You will hand it to the tester in the smug certainty that it is perfectly bug-free. Dream on, for without stress-testing you could easily let some of the most unpleasant bugs through.... Read more...
Close These Loopholes in Your Database Testing
by Alex Kuznetsov | 31 July 2007 |  15 comments |
Alex starts of a series of articles on 'Unit Testing' your database development work. He starts off by describing five simple rules that make all the difference. Read more...
Over 400,000 Microsoft professionals subscribe to the Simple-Talk technical journal. Join today, it's fast, simple, free and secure.

Join Simple Talk