Introduction

Sometimes all one wants is a good example. That’s our motivation for accepting the baton from Joe Sack and revising his excellent work to cover the very latest edition of Microsoft’s database engine—SQL Server 2012.

T-SQL is fundamental to working with SQL Server. Almost everything you do, from querying a table to creating indexes to backing up and recovering, ultimately comes down to T-SQL statements being issued and executed. Sometimes it’s a utility executing statements on your behalf. Other times you must write them yourself.

And when you have to write them yourself, you’re probably going to be in a hurry. Information technology is like that. It’s a field full of stress and deadlines, and don’t we all just want to get home for dinner with our families?

We sure do want to be home for dinner, and that brings us full circle to the example-based format you’ll find in this book. If you have a job to do that’s covered in this book, you can count on a clear code example and very few words to waste your time. We put the code first! And explain it afterward. We hope our examples are clear enough that you can just crib from them and get on with your day, but the detailed explanations are there if you need them.

We’ve missed a few dinners from working on this book. We hope it helps you avoid the same fate.

Who This Book Is For

SQL Server 2012 T-SQL Recipes is aimed at developers deploying applications against Microsoft SQL Server 2012. The book also helps database administrators responsible for managing those databases. Any developer or administrator valuing good code examples will find something of use in this book.

Conventions

Throughout the book, we’ve tried to keep to a consistent style for presenting SQL and results. Where a piece of code, a SQL reserved word, or a fragment of SQL is presented in the text, it is presented in fixed-width Courier font, such as this example:

SELECT * FROM HumanResources.Employee;

Where we discuss the syntax and options of SQL commands, we use a conversational style so you can quickly reach an understanding of the command or technique. We have chosen not to duplicate complex syntax diagrams that are best left to the official, vendor-supplied documentation. Instead, we take an example-based approach that is easy to understand and adapt.

Downloading the Code

The code for the examples shown in this book is available on the Apress web site, www.apress.com. A link can be found on the book’s information page (www.apress.com/9781430242000) on the Source Code/Downloads tab. This tab is located in the Related Titles section of the page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset