CHAPTER 3

image

Procedural Code and CASE Expressions

T-SQL has always included support for procedural programming in the form of control-of-flow statements and cursors. One thing that throws developers from other languages off their guard when migrating to SQL is the peculiar three-valued logic (3VL) we enjoy. In Chapter 1 we introduced you to SQL 3VL and we will expand on this topic further in this chapter. SQL 3VL is different from most other programming languages’ simple two-valued Boolean logic. We will also discuss T-SQL control-of-flow constructs, which allow you to change the normally sequential order of statement execution. Control-of-flow ...

Get Pro T-SQL 2012 Programmer's Guide, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.