Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Tell the Publisher!
I’d like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Defensive Database Programming with SQL Server [Paperback]

Alex Kuznetsov
4.0 out of 5 stars  See all reviews (1 customer review)

Currently unavailable.
We don't know when or if this item will be back in stock.


Formats

Amazon Price New from Used from
Paperback --  
Paperback, 21 Jun 2010 --  
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details. Learn more.

Book Description

21 Jun 2010
Resilient T-SQL code is code that is designed to last, and to be safely reused by others. The goal of defensive database programming, the goal 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. Too often as developers, we stop work as soon as our code passes a few basic tests to confirm that it produces the 'right result' in a given use case. We do not stop to consider what other possible ways in which the code might be used in the future, or how our code will respond to common changes to the database environment, such as a change in the database language setting, or a change to the nullability of a table column, and so on. In the short-term, this approach is attractive; we get things done faster. However, if our code is designed to be used for more than just a few months, then it is very likely that such changes can and will occur, and the inevitable result is broken code or, even worse, code that silently starts to behave differently, or produce different results. When this happens, the integrity of our data is threatened, as is the validity of the reports on which critical business decisions are often based. At this point, months or years later, and long after the original developer has left, begins the painstaking process of troubleshooting and fixing the problem. Would it not be easier to prevent all this troubleshooting from happening? Would it not be better to spend a little more time and effort during original development, to save considerably more time on troubleshooting, bug fixing, retesting, and redeploying? This is what defensive programming is all about: we learn what can go wrong with our code, and we proactively apply this knowledge during development. This book is filled with practical, realistic examples of the sorts of problems that beset database programs, including: - Changes in database objects, such as tables, constraints, columns, and stored procedures. - Changes to concurrency and isolation levels. - Upgrades to new versions of SQL Server. - Changes in requirements. - Code reuse. - Problems causing loss of data integrity. - Problems with error handling in T-SQL. In each case, it demonstrates approaches that will help you understand and enforce (or eliminate) the assumptions on which your solution is based, and to improve its robustness. Ultimately, the book teaches you how to think and develop defensively, and how to proactively identify and eliminate potential vulnerabilities in T-SQL code.


Product details

  • Paperback
  • Publisher: Red Gate Books (21 Jun 2010)
  • ISBN-10: 190643445X
  • ISBN-13: 978-1906434458
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (1 customer review)
  • Amazon Bestsellers Rank: 6,668,695 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, and more.

Product Description

About the Author

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 written multiple articles on simple-talk.com and devx.com, and contributed a chapter to "MVP Deep Dives" book. 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.

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

5 star
0
3 star
0
2 star
0
1 star
0
4.0 out of 5 stars
4.0 out of 5 stars
Most Helpful Customer Reviews
1 of 1 people found the following review helpful
4.0 out of 5 stars very good stab at a difficult subject 2 Sep 2010
Format:Paperback
This is a very good book that is based on practical experience. Reading it would save you trying days of coding and testing. I am very pleased to have read it and advise any sql coder to go through it.

It is very specific to sql server, rather than generic theory that may or may not apply to your installation.

Covers so many good ideas that will take years to understand and learn. some of which I am generally aware of but have not understood in details. Such as the behaviour of set and select.

Attempt to solve the problem with code reuse which is an almost impossible problem. SQL code is routinely duplicated to maintain a good performance (e.g. scalar functions aren't used - i've coded them in then out when things slowed down), so here there are some practical suggestions that should help the disillusioned.

I don't think i can fault it in any of the examples apart from a couple of typos it is very well written, at times there seem to be pages and pages of code with slightly different versions, but I guess that gives a very clear and step by step examples to prove solid points.

OK, I am not sure about de-normalising for sake of enforcing business logic in constraints, I am not sure if i can get this passed the architecture team (they will want to keep business rules in the application layer - despite the arguments in the book to the contrary), still I am really impressed with the creative approach (don't know if anyone else thought of doing this before), and will try to apply - but only if I can see the benefits outweigh the data duplication and the additional code complexity and its a big ask...

Although I have 10 years of sql but most of which spend on sql 2000, so in some way this was a useful read to see 2008 features put to use.

Also having part of the book as a free download is very generous, I hope (but doubt) redgate is paying some good money towards it.

Lastly, I wanted to get the last two chapters but its seems that I have to wait and can't find the guy's email to moan about it...
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 5.0 out of 5 stars  5 reviews
6 of 6 people found the following review helpful
5.0 out of 5 stars Useful and Informative.... 16 Jun 2010
By H. Treftz - Published on Amazon.com
Format:Paperback
I have worked with SQL Server as a developer and a programmer for over 15 years so I have read a lot of books about the product and T-SQL. This is one of the most informative books I have read on SQL in a long time because it made me think a little differently when looking at code. It presented me with situations I haven't seen before (for example a connection setting it's own rowcount explicitly) and the implications that could have.

It really makes you think about the what-if, what happens if your caller does something unexpected and what you might do to mitigate this risk. There are not a whole lot of SQL Server programming books that I learn something from anymore, this was one of them.
2 of 2 people found the following review helpful
5.0 out of 5 stars Great reading for database practitioners 28 Jan 2011
By Plamen Ratchev - Published on Amazon.com
Format:Paperback
This is excellent work on a very important topic. Defensive programming is very often misunderstood, especially in the database world.

Alex deals with this "inconvenient" topic using very practical approach. Instead of filling pages with theory and reasons why defensive programming is good, he dives right into simple examples from the daily work of every database professional. We have all seen (and ignored) many of these issues, but demonstrating how this affects our code and how simple it is to avoid these problems makes this book shine. It is not a complete catalog of defensive techniques, rather a good collection of examples to illustrate the need for defensive coding and applicable methods. It builds the mindset to think proactively and create robust solutions.

The book includes coverage of the following topics: basic defensive technique, code vulnerabilities, changes to database objects, upgrades, reusing code, data integrity and constraints, error handling, concurrency.

"Defensive Database Programming with SQL Server" should be required reading for all SQL practitioners.
1 of 1 people found the following review helpful
5.0 out of 5 stars Excellent book 13 April 2011
By Rand E. Gerald - Published on Amazon.com
Format:Paperback|Amazon Verified Purchase
I was at a presentation by the author about this subject last year (March 2010) even before the book was published. Unfortunately, the book was not published until several months later. If I recall correctly, I ordered it on a pre-release basis. I have not been disappointed.

If you go through the book you will very likely find reference to oversights that you may have made in the past and how to avoid them in the future.

The only negative I can say about the book is that I wish that it had more of the author's helpful hints. A good subject, perhaps, for a Volume 2.

By the way - where did the author get that beautiful cover photo? Where was it taken?
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!


Look for similar items by category


Feedback