Simple-Talk Publishing has released a new, free 291 page eBook called Defensive Database Programming with SQL Server, by Alex Kuznetsov. Here is what the book covers, as described from the book’s introduction.
“Resilient T-SQL code is code that is designed to last, and to be safely reused by others. The goal of defensive database programming, and of this book, is to help you to produce resilient T-SQL code that robustly and gracefully handles cases of unintended use, and is resilient to common changes to the database environment.