Excellent article describing some important new features in SQL 2014 Itzik. Now if I can just get my company to start pushing SQL 2014 I might get a chance to play with some of them. I use table...
Itzik - You gave a simple to understand and excellent technical explanation of both approaches. My hat's off to you and thanks.
Excellent follow up piece.
I want to thank you for mentioning the solution I posted to Part I. But I also want to give some credit where credit is due.
I turned a friend of mine on...
Here's an improvement (I think):
SELECT @Rows = (SELECT COUNT(*) FROM @P);
DECLARE @VAL INT = (SELECT TOP 1 val FROM @P ORDER BY keycol) ;
WITH OnlyNeededRows AS