There are a couple of new features of SQl Server 2008 that I’m pretty excited about that I haven’t seen geet agreat amount of attention. I thought I’d write a short article on them, so they don’t get overlooked.
- Variable initialisation
- Row constructors
- Multi-server queries
- Intellisense/syntax checking
I’ve always been more partial to the C# way of declaring and initialising variables all at once. Now it’s possible in T-SQL too.
DECLARE @SomeVariable INT = 0, @SomeOtherVariable CHAR(5) = ‘Hello’
It’s not revolutionary, but I do like it. Anything that reduces the amount of typing and reduces the chances of bugs is worthwhile in my opinion