Chapter 17. New T-SQL Features

SQL Server 2005 introduced several new built-in T-SQL functions, operators, and clauses, including the INTERSECT and EXCEPT operators and the DML statement OUTPUT clause. SQL Server 2008 supports these prior enhancements and adds some of its own. In this chapter, I will cover the developer-centric T-SQL features that I haven't discussed in previous chapters.

Set Operators

SQL Server has long supported the UNION and UNION ALL set-based operators to combine the results of multiple queries into a single result set. SQL Server 2008 also supports the INTERSECT and EXCEPT set-based operators, which allow you to use entire result sets to restrict the results returned by queries. The INTERSECT operator takes two queries, one ...

Get Pro T-SQL 2008 Programmer's Guide 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.