Defensive Database Programming with SQL Server



Download free course Defensive Database Programming with SQL Server, pdf file on 389 pages by Alex Kuznetsov.
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.

Table of contents

  • Basic Defensive Database Programming Techniques
  • Code Vulnerabilities Due to SQL Server Misconceptions
  • Surviving Changes to Database Objects
  • When Upgrading Breaks Code
  • Reusing T-SQL Code
  • Common Problems with Data Integrity
  • Advanced Use of Constraints
  • Defensive Error Handling
  • Concurrent Queries and Transaction Isolation Levels
  • Developing Modifications that Survive Concurrency
Pages : 389
Size : 8.6 MB
File type : PDF
Downloads: 123
Created: 2022-02-02
License: For personal or educational use
Author(s): Alex Kuznetsov
Defensive Database Programming with SQL Server

Others programming Tutorials

Fundamentals of C++ Programming

Fundamentals of C++ Programming

Mathematica® Programming: an Advanced Introduction

A Field Guide to Genetic Programming

Programming for Computations - Python, 2nd Edition

Others related eBooks about Defensive Database Programming with SQL Server

Introduction to Visual Cobol and Cobol for .NET

This PDF tutorial teachs you how to build your first application with Visual Cobol ,it provides an introduction to Visual COBOL and the COBOL for .NET language. It shows some basic features of COBOL for .NET,free training document under 30 pages for beginners....

Scratch programming guide in PDF

Download Scratch programming tutorial by Julian Screawn, Scratch facilitate learning programming by designing and using blocks to create animation, games and videos....

ASP.NET Core 3.1 Succinctly

Download free course ASP.NET Core 3.1 Succinctly, pdf file on 130 pages by by Simone Chiaretta, Ugo Lattanzi....

Essential C

This book written to provide clear and concise explanation of topics for programmers both starting to learn the C Programming Language as well as those diving in more complex topics. Most examples are linked to online playground that allows you to change the code and re-run it....

Programming Fundamentals: A Modular Structured Approach Using C++

This book is an introduction to computer programming using C++ as the language for writing programmes, and to solid, fundamental programming principles - including writing structured programmes, looping, data structures and iteration. ...

Problem Solving with Algorithms and Data Structures

Download free course Problem Solving with Algorithms and Data Structures, pdf file on 240 pages by Brad Miller, David Ranum....

Csharp Programming Tutorial

Download this C# PDF Tutorial for free, it's consisting of 5 chapters covering all the most important C# concepts. This tutorial is intended for beginner programmers, and we recommend you to go through all the chapters, to get the most out of it as possible....

: Advanced R

It is impossible to become expert in R in only one training course. Yet, this course aims at giving a wide understanding of many aspects of R. Some external resources will be referred to in this book for you to be able to deepen what you would have learned in this course....

2D Game Development: From Zero to Hero

Download free course 2D Game Development: From Zero to Hero, pdf file on 262 pages by Self-publishing....

Introduction to Kotlin

This course is a quick tutorial about Kotlin programming langage intended to beginners to learn how to create Android apps, free training document under 4 pages....