New T-SQL Shorthand Syntax

If you write a lot of T-SQL code, you will definitely appreciate these minor (but extremely handy) enhancements to the language syntax. These features may pale in the face of everything else new in SQL Server 2008, but they are welcome timesavers just the same and further demonstrate Microsoft’s continued investment and innovation in T-SQL.

We can finally declare and initialize variables with a single statement, and compound assignment operators are supported as well. Plus, row constructors allow you to build multiple rows of data inline. For example, you can now insert multiple rows of data with a single INSERT statement that wraps the operation in an implicit transaction. Example 2-72 shows the applied use of all of ...

Get Programming Microsoft® SQL Server™ 2008 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.