A very short post here showing some of the new T-SQL constructs in katmai.
Check out the following code snippet:
declare @i int = 1;
set @i += 1;
create table t1 (col1 int);
insert t1 values (@i),(@i+1);
There are actually three syntax enhancements in there. Can you spot them? No? Let me fill you in:
-
Initialisation at the same time as declaration
-
+= operator (which works in the SET clause of an UPDATE statement as well)
-
Multiple row predicates in the VALUES clause
Of course, none of these enhancements enable you to do something you can't do already - but they do mean less typing. Upon seeing this for the first time SQL MVP Kent Tegels was overheard muttering "Its T-SQL#"
-Jamie