OUT OF EVERY ENDING COMES the beginning of something new. This title has been Rob Vieira’s
for many years, and now he’s wrapping up that chapter of his life while I begin a new chapter of
my own — and the fi rst chapter of this text. Likewise, you, as a reader, are also entering something
of a transition; you know something about programming, probably, but you’re about to begin a
completely new experience as a programmer of relational databases in general and Microsoft SQL
Server 2012 in particular.
Database programming is a pretty big shift from most other kinds of software engineering. If you’re
at all like me, something brought you from your early programming experience (6502-based machines
in BASIC for me) to databases. For me it happened at Microsoft in the early ‘90s, supporting a beta
product that fl ew under the radar; I was asked to track certain aspects of the work I was doing in
Access (2.0 at that time). Once I learned to do that, I was hooked, and a couple years on the Access
support queue (learning SQL Server 4.2 and beyond as well) sealed the deal.
Working with SQL Server is a whole different animal from ordinary procedural programming.
You get to think in mathematical and set-based terms, and learn how to ask carefully for what you
want without spelling out how to actually accomplish the work. Transitioning from procedural
programming to this kind of thinking without help is like trying to make a paradigm shift without a
clutch. And yet this language, SQL, has a certain simplicity to it sometimes that makes it a pleasure
to work with, once you learn how to think like it thinks.
I learned from immersion, from Microsoft’s internal trainers, and from peers; what I wished for at
the time was a book I could read that would give me the concepts and the functional knowledge to
understand what I was seeing and know what was out there that I didn’t know about yet. This book
is the book I wanted, which means if you’re in that early learning phase with T-SQL, it’s probably
the book you need as well.
This is a step-by-step tutorial, providing you the concepts you need in bite-sized pieces presented
in an orderly way, each building on the last. The whole reason it exists is that you’d likely have a
terrible time picking up such a completely new set of concepts by choosing topics out of an online
help database. Books are still, in 2012, a great way to learn new ideas.
My hope is that, in this book, you fi nd something that covers all of the core elements of SQL Server
with the same success that we had in the original Professional SQL Server Programming titles.
When you’re done, you should be set to be a highly functional SQL Server 2012 programmer and,
with any luck, you’ll enjoy the unique challenges of database programming for years to come.